squad

right-to-left function composition

MIT 7 个版本
安装
npm install squad
yarn add squad
pnpm add squad
bun add squad
README

squad License NPM version Dependency Status Build Status

Right-to-left function composition. The rightmost function may have any arity. The remaining functions must be unary.

Install

npm i squad

How to use?

const squad = require('squad');

const buzz = (str) => str + '... zzz...';
const scream = (str) => str.toUpperCase();
const noise = squad(buzz, scream);

noise('hello');
// returns
'HELLO... zzz....'

Environments

In old node.js environments that supports es5 only, squad could be used with:

var squad = require('squad/legacy');

License

MIT

版本列表
3.0.0 2018-09-24
2.0.0 2018-02-16
1.1.3 2015-11-16
1.1.2 2015-10-24
1.1.1 2015-10-23
1.1.0 2015-10-19
1.0.0 2015-10-19