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

1.3.0 • Public • Published

🎒 Mochila

Your Lightweight Travel Companion for TypeScript Programming

Documentation

Philosophy

At the core of Mochila's philosophy is the commitment to a "data last" approach in writing functions. This design choice enables easy composition of functions using our internal pipe utility.

Additionally, Mochila embraces currying when necessary, allowing functions to be conveniently partially applied. This flexibility enhances the overall usability of the toolkit.

import { length, multiply, pipe } from 'mochila-ts';

const doubleLength = pipe(length, multiply(2));

doubleLength([1, 2, 3]); // 6
doubleLength('abc'); // 6

Mochila not only provides robust support for TypeScript but also comes equipped with handy utilities for seamlessly handling tasks such as caching and backpressuring.

import { LRUCache } from 'mochila-ts';

const cache = new LRUCache({
  max: 100,
  ttl: 1000 * 60 * 60 * 24,
});

All the utilities are exposed as named exports from the mochila-ts package.

Installation

npm install mochila-ts
# or
yarn add mochila-ts
# or
pnpm add mochila-ts

Readme

Keywords

none

Package Sidebar

Install

npm i mochila-ts

Weekly Downloads

3

Version

1.3.0

License

MIT

Unpacked Size

1.72 MB

Total Files

1327

Last publish

Collaborators

  • jmlweb