Skip to main content

The license of this software has changed to AWISC - Anti War ISC License

jetl

npm version ci release docs

JavaScript data processing with asynchronous iterators.

Documentation

Check out the documentation website.

Setup

npm i jetl

Usage

The example below comments out each line of the current file and prints the result

const fs = require('fs')

const { pipeline } = require('jetl')
const { first } = require('jetl/operators')
const { joinStrings, map, split } = require('jetl/operations')

const result = new pipeline() // instantiate pipeline
.add(fs.createReadStream(__filename)) // read file
.add(split()) // split into multiple lines
.add(map(line => `// ${line}`)) // prepend each line with a comment
.add(joinStrings('\n')) // join the lines together
.run() // execute the pipeline

console.log(await first(result)) // print the first (only) result