gulp-pattern-rename

0.4.0 • Public • Published

gulp-pattern-rename

NPM status

Pattern based rename

Usage

This is a gulp plugin for renaming files using properties.

var patternRename = require('gulp-pattern-rename');
 
patternRename({
  prefix: '__',//optional
  suffix: '__',//optional
  props: {
    valueToReplace: 'newValue',
    anotherValue: 'anotherNewValue',
    package: 'one.two.three'
  }
  meta: {
    package: {
      createSubfolders: true,
      //folderSeparator is optional, use only when the separator is different from the one provided here
      //for example if you have a value like 'one/two/three' for the 'package' property, then you should use '/' for the folderSeparator
      folderSeparator: '.'
    }
  }
})
 
This will replace a file name in the following way:
 
original
__valueToReplace__SomethingElse/__package__/__valueToReplace__-__anotherValue__.js
 
into
newValueSomethingElse/one/two/three/newValue-anotherNewValue.js

/gulp-pattern-rename/

    Package Sidebar

    Install

    npm i gulp-pattern-rename

    Weekly Downloads

    29

    Version

    0.4.0

    License

    Apache-2.0

    Last publish

    Collaborators

    • drginm