pull-uglify

0.5.0 • Public • Published

pull-uglify

Uglify JavaScript files with pull-stream

Compiles streamed files with uglify-js

pull(
  read([ 'index.js', 'test.js' ], { cwd: __dirname }),
  uglify({ mangle: true }),
  write('out', err => {
    // done
  })
)

You can also compile buffers with uglify.buffer if you aren't streaming files

Install

npm install --save pull-uglify
 
# with yarn 
yarn add pull-uglify

Usage

uglify(options?)

A stream that maps each file to the uglified version. See uglify-js's options for more information.

pull(
  read([ 'index.js', 'lib/**/*.js' ], { cwd: __dirname }),
  bundle('app.js', [ 'es2040' ]),
  uglify({ mangle: true }),
  write('out', err => {
    // ...
  })
)

uglify.buffer(options?)

The base implementation that compiles buffer to buffer, instead of file to file. Options are the same

pull(
  readFile('foo.js'),
  uglify.buffer({ mangle: true }),
  writeFile('foo.min.js')
)

Maintained by Jamen Marz (See on Twitter and GitHub for questions & updates)

Package Sidebar

Install

npm i pull-uglify

Weekly Downloads

1

Version

0.5.0

License

none

Last publish

Collaborators

  • npm