aa-util

0.1.0 • Public • Published

Async-await utility with stream

npm i aa-util

example

const au = require('aa-util')
 
// Type Array -> Stream
 
function *main(){
    const target = [0,1,2,3,4,5]
    const stream = yield au.stream.a2s(target);
 
    // pipe your custom stream
    stream.pipe(stream_A)
 
    // get stream result
    const result = yield au.stream.reduce(stream_A);
}
 
 
// Type Generator -> Stream
 
function *main(){
    const target = [0,1,2,3,4,5]
    const g = function *(){
        yield* target
    }
    const stream = yield au.stream.g2s(g());
    const result = yield au.stream.reduce(stream);
}

Readme

Keywords

Package Sidebar

Install

npm i aa-util

Weekly Downloads

0

Version

0.1.0

License

ISC

Last publish

Collaborators

  • uzuna