https://github.com/parro-it/ai-log
Tap into an async iterable pipeline and log all chunks passing through
https://github.com/parro-it/ai-log
Last synced: 10 months ago
JSON representation
Tap into an async iterable pipeline and log all chunks passing through
- Host: GitHub
- URL: https://github.com/parro-it/ai-log
- Owner: parro-it
- License: mit
- Created: 2017-11-30T19:32:26.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-04T19:34:35.000Z (about 8 years ago)
- Last Synced: 2024-10-11T07:53:31.522Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 222 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# ai-log
[](http://travis-ci.org/parro-it/ai-log)
[](https://npmjs.org/package/ai-log)
> Tap into an async iterable pipeline and log all chunks passing through
> **_This module is part of
> [Async iterable fun](https://github.com/parro-it/ai-fun), a complete toolset
> of modules to work with async iterables._**
## Usage
description of the example
```js
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](https://npmjs.org/) installed, run
```bash
npm install --save ai-log
```
## See Also
* [`parro-it/ai-fun`](https://github.com/parro-it/ai-fun) - A collection of
modules to easy deal with async iterables.
* [`noffle/common-readme`](https://github.com/noffle/common-readme) - « a common
readme for node ».
## License
MIT Licensed © 2017 Andrea Parodi