0.0.5 • Published 11 months ago

func-compose v0.0.5

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

func-compose

npm version npm downloads bundle Codecov License JSDocs

Compose a new function from smaller functions f(g(x))

Usage

Install package:

# npm
npm install func-compose

# yarn
yarn add func-compose

# pnpm
pnpm install func-compose

Import:

// ESM
import { compose } from "func-compose";

// CommonJS
const { compose } = require("func-compose");

function addOne(x) {
  return x + 1;
}

function multiplyByTwo(x) {
  return x * 2;
}

const result = compose(addOne, multiplyByTwo)(2); // 2 * 2 + 1 = 5

Development

  • Clone this repository
  • Install latest LTS version of Node.js
  • Enable Corepack using corepack enable
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

License

Made with 💛

Published under MIT License.

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago

0.0.0

11 months ago