GithubHelp home page GithubHelp logo

goto-bus-stop / minify-stream Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 13.0 32 KB

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

License: MIT License

JavaScript 100.00%
minify stream javascript uglify terser

minify-stream's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.