Socket
Socket
Sign inDemoInstall

jsmin2

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jsmin2

Another port of JSMin -- this time outputting a coordinate map


Version published
Weekly downloads
17K
decreased by-15.24%
Maintainers
1
Install size
440 kB
Created
Weekly downloads
 

Readme

Source

node-jsmin2 Build status Donate on Gittip

Another port of JSMin -- this time outputting a coordinate map

Getting Started

Install the module with: npm install node-jsmin2

Documentation

JSMin is a function that minifies a single set of JavaScript and outputs an object with a code and codeMap.

/**
 * jsmin - Refer to LICENSE in base directory
 * @param {String} input JavaScript to minifiy
 * @return {Object} retObj
 * @return {String} retObj.code Minified JavaScript
 * @return {Object} retObj.codeMap Point to point map from source JavaScript to minified JavaScript
 */

Example

// Load in jsmin and jQuery
var jsmin = require('node-jsmin2'),
    jquerySrc = fs.readFileSync('jquery.js', 'utf8');

// Process the jquery source via jsmin
var jqueryMinObj = jsmin(jquerySrc);

// Minified code is available at
// jqueryMinObj.code;

// Coordinate map of source code to minified code is available at
// jqueryMinObj.codeMap;

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint your code via grunt and test via npm test.

License

Copyright (c) 2012 Todd Wolfson The Software shall be used for Good, not Evil. (see LICENSE)

Keywords

FAQs

Last updated on 01 Feb 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc