0.0.7 • Published 2 years ago
jetl v0.0.7
jetl
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