minify-stream

minify javascript in a stream using uglify-js (ES5) or terser (ES6+)

Github stars Tracking Chart

minify-stream

minify javascript in a stream using uglify-js

npm
travis
standard

Install

npm install minify-stream

Usage

var minifyStream = require('minify-stream')

fs.createReadStream('app.js')
  .pipe(minifyStream())
  .pipe(fs.createWriteStream('app.min.js'))

API

minifyStream(?options)

Create a new minify stream. Write a Javascript file or bundle to it.
Possible options are:

  • uglify - An uglify module to use, defaults to terser.
    It must have an uglify-compatible minify() function.
  • All other options are passed to the minify() function as the second parameter.
    See the terser docs for available options.

minify-stream adds inline source maps by default. Use exorcist
to extract source maps from the output stream into a separate file. If you don't need source maps, pass
the sourceMap: false option to disable them.

minifyStream({ sourceMap: false })

License

MIT

Main metrics

Overview
Name With Ownergoto-bus-stop/minify-stream
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
Platform
License:MIT License
所有者活动
Created At2017-09-27 09:43:13
Pushed At2021-04-29 21:12:06
Last Commit At
Release Count7
Last Release Namev2.1.0 (Posted on )
First Release Namev1.0.0 (Posted on 2017-09-27 11:46:15)
用户参与
Stargazers Count27
Watchers Count2
Fork Count13
Commits Count29
Has Issues Enabled
Issues Count3
Issue Open Count1
Pull Requests Count6
Pull Requests Open Count2
Pull Requests Close Count10
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private