A collection of functional utilities that complement lodash/fp with async support, lenses, aspects, and tree operations.
Futil-js is a functional utility library that extends lodash/fp with additional helpers for async workflows, lens-based state management, aspect-oriented programming, and tree operations. It solves common JavaScript development pain points by providing missing utilities like async function composition, flexible getter/setter abstractions, and nested data structure transformations.
JavaScript developers working with functional programming patterns, especially those using lodash/fp who need enhanced async support, lens utilities for state management, or tree manipulation capabilities.
Developers choose Futil-js because it fills specific gaps in lodash/fp with well-designed utilities like flowAsync for async composition, a pragmatic lens system compatible with React and MobX, and comprehensive tree traversal functions—all while maintaining functional purity and composability.
F(unctional) util(ities). Resistance is futile.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
flowAsync seamlessly composes async and sync functions, automatically handling arrays and objects of promises with Promise.all and promiseProps, solving common issues in functional pipelines.
The lens system supports multiple formats like React hooks, MobX, and plain objects, with DOM bindings (e.g., domLens.value) for easy integration into UI frameworks, offering versatile state management.
Lightweight aspects (aspect, aspectSync) allow wrapping functions for cross-cutting concerns like logging and error handling, with built-in aspects for status tracking and concurrency control.
Functions like walk, mapTree, and flattenTree provide customizable traversal and transformation of nested data structures, filling a gap in many utility libraries for complex data manipulation.
The README is generated from jsdoc and can be dense and technical, with auto-generated content that may lack beginner-friendly explanations or practical examples outside of unit tests.
Requires lodash/fp as a dependency, which can increase bundle size and lead to version conflicts in projects not already using lodash, adding overhead for minimal use cases.
Functions like *_On (e.g., setOn, mergeOn) encourage mutation, which conflicts with functional programming principles and can introduce bugs in codebases prioritizing immutability.