Installation
Install @hyperse/pipeline in your project.
Package install
npm install @hyperse/pipelineRequirements
- Node.js 16 or newer
- TypeScript 4.5 or newer (for full type inference)
The package ships both ESM and type declarations:
{
"exports": {
".": {
"import": "./index.js",
"types": "./dist/index.d.ts"
}
}
}Verify the install
Import either paradigm and check that types resolve:
import { Pipeline, pipe } from '@hyperse/pipeline';
const engine = new Pipeline<{ ok: boolean }>();
const run = pipe(
() => 1,
(n) => n + 1
);
console.log(typeof engine.use, typeof run);Optional integrations
The monad helpers are dependency-free, but to use monads you need the corresponding library installed:
npm install monetOr, for fp-ts / purify-ts:
npm install fp-tsimport { Either, Maybe } from 'monet';