• Packages
  • Themes
  • Documentation
  • Blog
  • Discuss
Sign in

js-onsave

Run yui compressor command when you save a javascript file
  • #js
  • #save
  • #file
  • #watch
  • #execute
FoxinouFR
0.0.2 750
1
  • Repo
  • Bugs
  • Versions
  • License
Flag as spam or malicious

js-onsave

Atom package to run the yui compressor when you save a .js file.

Dependencies

The package uses yui compressor which is a binary in Java. To install Java, please visit official website.

Installation

Use atom package manager to install js-onsave.

apm install js-onsave

Configuration file

You need to create a configuration file named .js-onsave.json at the root of the project.

The content of the .js-onsave.json file must be an array of objects with the following properties:

  • inputDir: The source directory. The path is relative to .js-onsave.json.
  • outputDir: The destination directory. The path is relative to .js-onsave.json.
  • javaBin (default to "java"): You can set the path to the Java executable with this parameter.
  • outputFilename (default to $1.min.js): Set the file name template once they are compressed. The symbol $1 represents the name of the file without extension.
  • showStartup (default to false): A boolean indicating whether a notification at startup of compilation should be displayed or not.
  • showOutput (default to false): A boolean indicating whether the output stream should be displayed or not.
  • showError (default to true): A boolean indicating whether the error stream should be displayed or not.

Example

Here is an example of a configuration file.

{
	"inputDir": "resources/js/",
	"outputDir": "public/js/",
	"outputFilename": "$1.min.js",
	"javaBin": "java",
	"showStartup":false,
	"showOutput":true,
	"showError":true
}

Compile SCSS

You can use the scss-onsave package that works the same way for SCSS files.

Credits

This atom package contains the compiled executable of yui-compressor in version 2.4.8.

Source : https://github.com/yui/yuicompressor

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
with by