apm install on-save
Create an .on-save.json
file at the root of your project (or anywhere in the path of the files you want to watch).
For example, if you want to babelify every .js
file from src
to dist
, the .on-save.json
file content might be something like:
[{"srcDir": "src","destDir": "dist","files": "**/*.js","command": "babel ${srcFile} --out-file ${destFile}"}]
The content of the .on-save.json
file must be an array of objects with the following properties:
srcDir
(default to .on-save.json
's directory): The source directory.destDir
(default to srcDir
): The destination directory.files
: The files you want to track. You can use a glob (see minimatch), or an array of globs.command
: The command to execute. You can use these variables:
${srcFile}
: The input file.${destFile}
: The output file.${destFileWithoutExtension}
: The output file without the extension.showOutput
(default to false
): A boolean indicating whether the output stream (stdout) should be displayed or not.showError
(default to true
): A boolean indicating whether the error stream (stderr) should be displayed or not.MIT
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.