{ "name": "gulp-rename", "version": "1.2.0", "description": "Rename files", "keywords": [ "gulpplugin" ], "homepage": "https://github.com/hparra/gulp-rename", "bugs": { "url": "https://github.com/hparra/gulp-rename/issues" }, "author": { "name": "Hector Guillermo Parra Alvarez", "email": "hector@hectorparra.com", "url": "https://github.com/hparra" }, "main": "./index.js", "repository": { "type": "git", "url": "git://github.com/hparra/gulp-rename.git" }, "scripts": { "test": "mocha test/*.spec.js" }, "devDependencies": { "map-stream": ">=0.0.4", "mocha": ">=1.15.0", "should": ">=2.1.0", "gulp": ">=3.0.0", "gulp-jshint": ">=1.1.0" }, "engines": { "node": ">=0.10.0", "npm": ">=1.2.10" }, "licenses": [ { "type": "MIT" } ], "readme": "# gulp-rename\n\ngulp-rename is a [gulp](https://github.com/wearefractal/gulp) plugin to rename files easily.\n\n## Usage\n\ngulp-rename provides simple file renaming methods.\n\n```javascript\nvar rename = require(\"gulp-rename\");\n\n// rename via string\ngulp.src(\"./src/main/text/hello.txt\")\n\t.pipe(rename(\"main/text/ciao/goodbye.md\"))\n\t.pipe(gulp.dest(\"./dist\")); // ./dist/main/text/ciao/goodbye.md\n\n// rename via function\ngulp.src(\"./src/**/hello.txt\")\n\t.pipe(rename(function (path) {\n\t\tpath.dirname += \"/ciao\";\n\t\tpath.basename += \"-goodbye\";\n\t\tpath.extname = \".md\"\n\t}))\n\t.pipe(gulp.dest(\"./dist\")); // ./dist/main/text/ciao/hello-goodbye.md\n\n// rename via hash\ngulp.src(\"./src/main/text/hello.txt\", { base: process.cwd() })\n\t.pipe(rename({\n\t\tdirname: \"main/text/ciao\",\n\t\tbasename: \"aloha\",\n\t\tprefix: \"bonjour-\",\n\t\tsuffix: \"-hola\",\n\t\textname: \".md\"\n\t}))\n\t.pipe(gulp.dest(\"./dist\")); // ./dist/main/text/ciao/bonjour-aloha-hola.md\n```\n\n**See test/rename.spec.js for more examples and test/path-parsing.spec.js for hairy details.**\n\n## Notes\n\n* `dirname` is the relative path from the base directory set by `gulp.src` to the filename.\n * `gulp.src()` uses glob-stream which sets the base to the parent of the first directory glob (`*`, `**`, [], or extglob). `dirname` is the remaining directories or `./` if none. glob-stream versions >= 3.1.0 (used by gulp >= 3.2.2) accept a `base` option, which can be used to explicitly set the base.\n * `gulp.dest()` renames the directories between `process.cwd()` and `dirname` (i.e. the base relative to CWD). Use `dirname` to rename the directories matched by the glob or descendents of the base of option.\n * KNOWN ISSUE: The base set when using brace expansion may not be what you expect (See wearefractal/glob2base#1). Use the `base` option described above.\n* `basename` is the filename without the extension like path.basename(filename, path.extname(filename)).\n* `extname` is the file extension including the '.' like path.extname(filename).\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License)\n", "readmeFilename": "README.md", "_id": "gulp-rename@1.2.0", "_from": "gulp-rename@" }