npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

build-minify-js

v1.0.1

Published

build-minify-js is a JavaScript build tool designed to compress JavaScript code.

Readme

build-minify-js

build-minify-js is a JavaScript build tool designed to compress JavaScript code.

What it does ?

  • Replaces Variable Names: build-minify-js optimizes your code by replacing lengthy variable names with shortened, efficient alternatives.
  • Removes Unnecessary Elements: It eliminates spaces, comments, and line breaks from your JavaScript code, resulting in a more compact and efficient script.
  • Minifies Code: Reduces the size of your JavaScript code by eliminating unnecessary characters and whitespace while preserving its functionality. This makes your code more efficient and improves load times for your web applications.
  • Generates Source Maps: The tool creates source maps that facilitate easy debugging, allowing you to trace and fix issues in your original code.

Installation

First make sure you have installed the latest version of node.js (You may need to restart your computer after this step).

You can install build-minify-js globally using npm:

npm install -g build-minify-js

Alternatively, you can include it as a development dependency in your project:

npm install --save-dev build-minify-js

Usage

To use build-minify-js, follow the instructions below in your terminal. You can minify a single JavaScript file using the following command:

node node_modules/build-minify-js/src/index.js <file-path>.js

Replace <file-path>.js with the actual file path of the JavaScript file you want to minify. This command will process the specified file and generate a minified version.

Example:

Lets build the below javascript code.

function sum(var1, var2) {
    return var1 + var2
}
sum(10,26)

When you run this commad.

node node_modules/build-minify-js/src/index.js path/to/your/script.js

This will minify script.js and create a minified & source-map files as script.min.js & script.min.js.map in the same directory.

script.min.js

function a(b,c){return b+c;}a(10,26);
//# sourceMappingURL=script.min.js.map

script.min.js.map

{"version":3,"sources":["index.min.js"],"names":["a","b","c"],"mappings":"SAASA,EAAIC,EAAMC,UACRD,EAAOC,GAElBF","file":"index.min.js","sourcesContent":["function sum(var1, var2) {\n    return var1 + var2\n}\nsum(10,26)\n"]}

Available Scripts

  • minify: To generate minified code and source maps.
npm run minify
  • minify-and-run: To execute the minification above minify command and execute the minified *.min.js file.
npm run minify-and-run
  • start: To run the minified *.min.js file.
npm start
  • clean: To delete all the *.min.js and *.min.js.map files.
npm run clean

Contributing

Contributions are welcome! If you'd like to contribute to build-minify-js, please check out our contributing guidelines.

Acknowledgments

  • build-minify-js relies on the Acorn parser to parse javascript code to AST.
  • escodegen to generated AST back to javascript code.
  • Source maps are generated using source-map.

Author

Rakesh Kumar Singh

GitHub: https://github.com/rakeshkumar1019