smart-preprocessor
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -31,6 +31,7 @@ /* | ||
var fs = require( 'fs' ) ; | ||
var path = require( 'path' ) ; | ||
var hash = require( 'hash-kit' ) ; | ||
//var tree = require( 'tree-kit' ) ; | ||
var osTmpDir = require( 'os' ).tmpdir() ; | ||
//var osTmpDir = require( 'os' ).tmpdir() ; | ||
@@ -209,3 +210,7 @@ | ||
outputPath = osTmpDir + '/' + outputFilename + '.js' ; | ||
// This does not works: osTmpDir does not have a node_module directory | ||
//outputPath = osTmpDir + '/' + outputFilename + '.js' ; | ||
outputPath = path.dirname( resolvedPath ) + '/' + outputFilename + '.pproc.js' ; | ||
//console.log( "outputPath: " , outputPath ) ; | ||
@@ -212,0 +217,0 @@ |
{ | ||
"name": "smart-preprocessor", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "A smart preprocessor for Node.", | ||
@@ -5,0 +5,0 @@ "main": "lib/smartPreprocessor.js", |
@@ -11,9 +11,43 @@ | ||
## Comment syntax | ||
## smart-preprocessor: the CLI program | ||
After installing it globally, using `npm install -g smart-preprocessor`, we can run it from everywhere. | ||
* `//# param : [code]` if param is set, the code is uncommented. | ||
* `[code] //# param !` if param is set, the code is commented. | ||
* `/*# param :\n [multiline-code] \n//*/` if param is set, the code is uncommented. | ||
* `//*# param :\n [multiline-code] \n//*/` if param is set, the code is commented. | ||
The syntaxe is simple: | ||
`smart-preprocessor <source-file> [dest-file] [--parameter1 value1] [--parameter2 value2] [...]`. | ||
If *dest* is not passed, the standard output will be assumed. It's useful if we have to pipe to another program. | ||
All the *parameters* are identifiers you refer in your source-file. See below. | ||
Some examples: | ||
* `smart-preprocessor main.js main.debug.js --debug`: build the main.debug.js file from main.js, using the *debug* parameter | ||
* `smart-preprocessor main.js main.trace.js --loglevel trace`: build the main.trace.js file from main.js, | ||
setting the *loglevel* parameter to 'trace' | ||
## Conditional comment syntax | ||
### `//# <condition> : <inline-code>` | ||
If *condition* is true, then the code is uncommented. | ||
Example, source code: | ||
``` | ||
``` | ||
### `<code> //# <condition> !` if <condition> is set, the code is commented. | ||
### `/*# <condition> :\n <multiline-code> \n//*/` if <condition> is set, the code is uncommented. | ||
### `//*# <condition> :\n <multiline-code> \n//*/` if <condition> is set, the code is commented. | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54943
641
53