graspify2
v1.0.1
Published
Browserify transform to replace code via grasp
Downloads
5
Maintainers
Readme
graspify2
Browserify transform to make source code replacements using grasp.
This is a clone from [email protected], which was broken.
Installing
$ npm install --save-dev graspify2
package.json
Replace DEBUG
with false
{
"browserify": {
"transform":[
["graspify2", { "patterns": ["squery", "#DEBUG", "false"] }]
]
}
}
API
Also can be used programmatically:
var browserify = require('browserify');
var b = browserify('./entry.js');
var graspify = require('graspify2');
b.transform(graspify, {
patterns: [
["squery", "#myVar", "myVariable"],
["equery", "__ + __", "{{.r}} + {{.l}}"],
["equery", "require($module)", function(){
return "require('stub')"
}]
]
})
options
patterns
Type: Array
Each replacing rule is denoted by a triplet.
If more than one rules specified, .patterns
should be something like the example in API
.