hoolock
TypeScript icon, indicating that this package has built-in type declarations

2.2.1 • Public • Published

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

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

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

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

React Compatible

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.

Package Sidebar

Install

npm i hoolock

Weekly Downloads

5

Version

2.2.1

License

MIT

Unpacked Size

114 kB

Total Files

162

Last publish

Collaborators

  • elijahharry