Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.06 KB

README.md

File metadata and controls

54 lines (37 loc) · 1.06 KB

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