{"name":"gulp-rename","version":"2.1.0","keywords":["gulpplugin"],"author":{"url":"https://github.com/hparra","name":"Hector Guillermo Parra Alvarez","email":"hector@hectorparra.com"},"license":"MIT","_id":"gulp-rename@2.1.0","maintainers":[{"name":"hparra","email":"hector@hectorparra.com"},{"name":"fractal","email":"contact@wearefractal.com"},{"name":"shinnn","email":"snnskwtnb@gmail.com"},{"name":"hgpa","email":"hector@hectorparra.com"},{"name":"yocontra","email":"yo@contra.io"}],"homepage":"https://github.com/hparra/gulp-rename","bugs":{"url":"https://github.com/hparra/gulp-rename/issues"},"dist":{"shasum":"3a9900f81f3a8338409ea5ea542affc25080d9f4","tarball":"http://registry-npm.ywwl.com/gulp-rename/download/gulp-rename-2.1.0.tgz","fileCount":4,"integrity":"sha512-dGuzuH8jQGqCMqC544IEPhs5+O2l+IkdoSZsgd4kY97M1CxQeI3qrmweQBIrxLBbjbe/8uEWK8HHcNBc3OCy4g==","signatures":[{"sig":"MEUCIFK8FSsK8629HkLg75f3DoFgXSqsMVxtrO0VWQeAsI6vAiEAxJYHbmdEWFs+ISIf7H43ttC2KLznRciAsOIErxAzxQA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6907,"size":3024,"noattachment":false,"key":"/gulp-rename/-/gulp-rename-2.1.0.tgz"},"main":"./index.js","engines":{"node":">=4"},"gitHead":"d5a11681749fe3232cc3696c0cca3ca095ee47f9","scripts":{"test":"mocha","pretest":"prettier --single-quote --write index.js test/**/*.js"},"_npmUser":{"name":"yocontra","actor":{"name":"yocontra","type":"user","email":"yo@contra.io"},"email":"yo@contra.io"},"repository":{"url":"git://github.com/hparra/gulp-rename.git","type":"git"},"_npmVersion":"11.4.2","description":"Rename files","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"devDependencies":{"gulp":"^5.0.1","mocha":"^11.0.0","vinyl":"^3.0.0","should":"^13.2.3","prettier":"^3.0.0","map-stream":"^0.0.7","gulp-sourcemaps":"^2.6.5"},"_npmOperationalInternal":{"tmp":"tmp/gulp-rename_2.1.0_1750915203933_0.28367733615749735","host":"s3://npm-registry-packages-npm-production"},"readme":"# gulp-rename\n\ngulp-rename is a [gulp](https://github.com/wearefractal/gulp) plugin to rename files easily.\n\n[![NPM](https://nodei.co/npm/gulp-rename.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/gulp-rename/)\n\n[![CI](https://github.com/hparra/gulp-rename/actions/workflows/ci.yml/badge.svg?branch=master)](http://travis-ci.org/hparra/gulp-rename)\n[![NPM VERSION](https://img.shields.io/npm/v/gulp-rename.svg?sanitize=true)](https://www.npmjs.com/package/gulp-rename)\n\n## Usage\n\ngulp-rename provides simple file renaming methods.\n\n```javascript\nvar rename = require(\"gulp-rename\");\n\n// rename to a fixed value\ngulp.src(\"./src/main/text/hello.txt\")\n  .pipe(rename(\"main/text/ciao/goodbye.md\"))\n  .pipe(gulp.dest(\"./dist\")); // ./dist/main/text/ciao/goodbye.md\n\n// rename via mutating function\ngulp.src(\"./src/**/hello.txt\")\n  .pipe(rename(function (path) {\n    // Updates the object in-place\n    path.dirname += \"/ciao\";\n    path.basename += \"-goodbye\";\n    path.extname = \".md\";\n  }))\n  .pipe(gulp.dest(\"./dist\")); // ./dist/main/text/ciao/hello-goodbye.md\n\n// rename via a map function\ngulp.src(\"./src/**/hello.txt\")\n  .pipe(rename(function (path) {\n    // Returns a completely new object, make sure you return all keys needed!\n    return {\n      dirname: path.dirname + \"/ciao\",\n      basename: path.basename + \"-goodbye\",\n      extname: \".md\"\n    };\n  }))\n  .pipe(gulp.dest(\"./dist\")); // ./dist/main/text/ciao/hello-goodbye.md\n\n// rename via a fixed object\ngulp.src(\"./src/main/text/hello.txt\", { base: process.cwd() })\n  .pipe(rename({\n    dirname: \"main/text/ciao\",\n    basename: \"aloha\",\n    prefix: \"bonjour-\",\n    suffix: \"-hola\",\n    extname: \".md\"\n  }))\n  .pipe(gulp.dest(\"./dist\")); // ./dist/main/text/ciao/bonjour-aloha-hola.md\n```\n\n**See [test/rename.spec.js](test/rename.spec.js) for more examples and [test/path-parsing.spec.js](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* `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* when using a function, a second `file` argument is provided with the whole context and original file value.\n* when using a function, if no `Object` is returned then the passed parameter object (along with any modifications) is re-used.\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License)\n","publish_time":1750915204165,"_cnpm_publish_time":1750915204165,"dist-tags":{"latest":"2.1.0"}}