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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@phoenix-plugin-registry/ktayfer.jscompiler

v2.1.1

Published

Compress your JavaScript code from multiple files into one minified file (Powered by UglifyJS2).

Downloads

3

Readme

JSCompiler2 for Brackets

JSCompiler2 is a tool for Brackets that allows you to compress and mangle your JavaScript code into one minified file, powered by UglifyJS2

Features

  • Doesn't require previous configurations for quick first use.
  • Customize advanced compilation options.
  • Compile multiple javascripts into one output.
  • Generate multiple outputs at once.
  • Works even offline.

Usage

Simply press the "Compress JavaScript" button on the sidebar, or go to File > Compress JavaScript, and your code will be compressed into a {filename}.min.js file.

Optionally, you can toggle "Compress JavaScript on Save" by going to File > Compress JavaScript on Save, and your code will be compressed automatically. This options is off by default.

The custom options file

You can go to File > Compress JavaScript: Options to open your custom options. If you have no custom options yet, you will be asked to choose one of this types of custom options:

  • Project: Bracket's default. This will add your options to the default .brackets.json file along with all the other options shared inside your current project. Your options will be inside an object with the indentifier jscompiler.

  • Portable: This will add your options to a .jscompiler.json file inside the current directory, which can be compatible with other compilers that use the same standard, and allows you to create multiple compilable projects inside your main project. On contrast, the current open file on your editor must be inside the same directory of the options file at the moment of compiling, or it will be ignored.

When the compilation starts, JSCompiler will give priority to any .jscompiler.json in the current folder, as this option will allow you to have custom sub-projects inside your main project. Then, it will search for any global options in the current project inside .brackets.json. If no option is found anywhere, it will attempt to compile then the current file, if it is a Javascript file.

Custom options

In your options file, you can customize next values:

  • Inputs: An array of javascript files to be compressed into the minified file.
  • Output: The name of the resulting minified file.
  • GenerateMap: A boolean value. If this is false, the source map for the code won't be generated.
  • Mangle: A boolean value. If this is false, the code won't be mangled.
  • Isolate: A boolean value. If this is true, the resulting code will be isolated so it won't affect or be affected by other scripts.
  • Precompile: A boolean value. If this is true, the resulting code will be precompiled before it is parsed. This option is hidden by default, and should be used only if your code really requires it, as the resulting source map won't be able to point to the original source files.

If the isolate option is true, the resulting code will be wrapped with the next code:

(function(window, undefined){
   // Your compiled code
}(window));

You can create multiple outputs by adding more JSON objects to the main outputs array.

Also, you can customize the default template for new projects at File > Compress JavaScript: Options template. Careful! This is only for advanced users. Updates will restore the template to prevent unexpected crashes.

Special thanks

To Steffen Bruchmann and Peter Flynn, who helped me a lot on my first steps with brackets extension development.

Also to miladd3, elegos, mrmckeb, kevinmerckx and bbak for their support and ideas through GitHub.

To mrmckeb for the new compiler icon.

And to randdusing and henrylavoo for the auto-compile on save feature.