npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

ai-log

1.1.0 • Public • Published

ai-log

Travis Build Status NPM downloads

Tap into an async iterable pipeline and log all chunks passing through

This module is part of Async iterable fun, a complete toolset of modules to work with async iterables.

Usage

description of the example

import log from "ai-log";
import map from "ai-map";
import compose from "compose-function";
 
const double = map.with(n => n * 2);
const add2 = map.with(n => n + 2);
const calculate = compose(
  log("add2 result"),
  add2,
  log("double result"),
  double
);
calculate([1, 2, 3]);

This will output

[double result] 2
[add2 result] 4
[double result] 4
[add2 result] 6
[double result] 6
[add2 result] 8

API

Install

With npm installed, run

npm install --save ai-log

See Also

License

MIT Licensed © 2017 Andrea Parodi

install

npm i ai-log

Downloadsweekly downloads

15

version

1.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability