aster-rename-ids
v1.1.1
Published
Rename ids with aster.
Downloads
8
Maintainers
Readme
aster-rename-ids
Rename ids with aster.
Usage
First, install aster-rename-ids
as a development dependency:
npm install --save-dev aster-rename-ids
Then, add it to your build script:
var aster = require('aster');
var renameIds = require('aster-rename-ids');
aster.src('src/**/*.js')
.map(renameIds({
from: /^_(.*)$/,
to: function () {
return '$' + privateIndex++;
}
}))
.map(aster.dest('dist'))
.subscribe(aster.runner);
API
renameIds(options)
options.from
Type: RegExp
Pattern for identifiers you want to rename.
options.to
Type: String
| Function
Replacement for given identifier patterns.