package.json 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {
  2. "name": "gulp-rename",
  3. "version": "1.2.0",
  4. "description": "Rename files",
  5. "keywords": [
  6. "gulpplugin"
  7. ],
  8. "homepage": "https://github.com/hparra/gulp-rename",
  9. "bugs": {
  10. "url": "https://github.com/hparra/gulp-rename/issues"
  11. },
  12. "author": {
  13. "name": "Hector Guillermo Parra Alvarez",
  14. "email": "[email protected]",
  15. "url": "https://github.com/hparra"
  16. },
  17. "main": "./index.js",
  18. "repository": {
  19. "type": "git",
  20. "url": "git://github.com/hparra/gulp-rename.git"
  21. },
  22. "scripts": {
  23. "test": "mocha test/*.spec.js"
  24. },
  25. "devDependencies": {
  26. "map-stream": ">=0.0.4",
  27. "mocha": ">=1.15.0",
  28. "should": ">=2.1.0",
  29. "gulp": ">=3.0.0",
  30. "gulp-jshint": ">=1.1.0"
  31. },
  32. "engines": {
  33. "node": ">=0.10.0",
  34. "npm": ">=1.2.10"
  35. },
  36. "licenses": [
  37. {
  38. "type": "MIT"
  39. }
  40. ],
  41. "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",
  42. "readmeFilename": "README.md",
  43. "_id": "[email protected]",
  44. "_from": "gulp-rename@"
  45. }