Skip to content

asterjs/aster-rename-ids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aster-rename-ids

NPM version Build Status

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.

License

MIT License

Releases

No releases published

Packages

No packages published