JSPM

@futagoza/pump

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q43323F
  • License MIT

A wrapper around pump to use promises and normal functions.

Package Exports

  • @futagoza/pump

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@futagoza/pump) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

A wrapper around stream.pipeline (based on pump) that:

  • returns a promise
  • accepts the use of promises, as well as normal functions
  • accepts a single item
  • only allows a function, promise or stream to be passed
const pump = require( "@futagoza/pump" );
const fs = require( "fs" );

const source = fs.promises.readFile( "./package.json", "utf8" );
const getVersion = data => JSON.parse( data ).version;
const dest = fs.createWriteStream( "./VERSION" );

pump( source, getVersion, dest )
    .then( () => console.log( "Done!" ) )
    .catch( err => console.error( err ) );

History license

@futagoza/pump is Copyright (c) 2018+ Futago-za Ryuu