2.2.1 • Published 3 months ago

hoolock v2.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

hoolock

Suite of 43 lightweight utilities designed to maintain a small footprint when bundled, without compromising on ease of integration and use. Heavily inspired by lodash, I created hoolock to meet my own needs and preferences, which are primarily concerned with size.

Features

Tree-Shakable :white_check_mark:

The main entry point exports all utilities as named exports; however, is designed to be tree-shakable by most modern bundlers. As of version 2.0.0, each release has tree-shakability tested in rollup and esbuild (on minimal or default tree-shaking settings).

Individual imports should not be necessary in most environments. Despite this, hoolock maintains a modular design, with a unique entry point for each of the 43 utilities.

Built-ins Preferred :white_check_mark:

JavaScript's built-in functions, such as Array.prototype.map, Array.prototype.forEach and Object.keys, are prioritized to minimize size and improve performance. Utilities with built-in 'equivalents' are typically extensions. For example, join accepts a distinct, final delimiter; however, still leverages Array.prototype.join internally.

CJS & ESM Support :white_check_mark:

Despite its compact size, hoolock contains builds for both CommonJS (CJS) and ECMAScript Modules (ESM).

React Compatible :white_check_mark:

Several utilities were built with React integrations in mind. For example, clone, cloneDeep and merge will ignore/preserve React elements. Additionally, many utilities (e.g. merge) are immutable, following React's state management principles.