Installations
npm install gulp-rename
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=4
Node Version
10.16.2
NPM Version
6.13.2
Score
99.8
Supply Chain
88.2
Quality
81.2
Maintenance
100
Vulnerability
100
License
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
hparra
Download Statistics
Total Downloads
303,487,160
Last Day
73,838
Last Week
555,845
Last Month
2,651,623
Last Year
32,594,087
GitHub Statistics
692 Stars
97 Commits
73 Forks
16 Watching
1 Branches
19 Contributors
Package Meta Information
Latest Version
2.0.0
Package Id
gulp-rename@2.0.0
Size
3.10 kB
NPM Version
6.13.2
Node Version
10.16.2
Publised On
04 Dec 2019
Total Downloads
Cumulative downloads
Total Downloads
303,487,160
Last day
-35.9%
73,838
Compared to previous day
Last week
-11%
555,845
Compared to previous week
Last month
-9.8%
2,651,623
Compared to previous month
Last year
-5.5%
32,594,087
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
7
gulp-rename
gulp-rename is a gulp plugin to rename files easily.
Usage
gulp-rename provides simple file renaming methods.
1var rename = require("gulp-rename"); 2 3// rename to a fixed value 4gulp.src("./src/main/text/hello.txt") 5 .pipe(rename("main/text/ciao/goodbye.md")) 6 .pipe(gulp.dest("./dist")); // ./dist/main/text/ciao/goodbye.md 7 8// rename via mutating function 9gulp.src("./src/**/hello.txt") 10 .pipe(rename(function (path) { 11 // Updates the object in-place 12 path.dirname += "/ciao"; 13 path.basename += "-goodbye"; 14 path.extname = ".md"; 15 })) 16 .pipe(gulp.dest("./dist")); // ./dist/main/text/ciao/hello-goodbye.md 17 18// rename via a map function 19gulp.src("./src/**/hello.txt") 20 .pipe(rename(function (path) { 21 // Returns a completely new object, make sure you return all keys needed! 22 return { 23 dirname: path.dirname + "/ciao", 24 basename: path.basename + "-goodbye", 25 extname: ".md" 26 }; 27 })) 28 .pipe(gulp.dest("./dist")); // ./dist/main/text/ciao/hello-goodbye.md 29 30// rename via a fixed object 31gulp.src("./src/main/text/hello.txt", { base: process.cwd() }) 32 .pipe(rename({ 33 dirname: "main/text/ciao", 34 basename: "aloha", 35 prefix: "bonjour-", 36 suffix: "-hola", 37 extname: ".md" 38 })) 39 .pipe(gulp.dest("./dist")); // ./dist/main/text/ciao/bonjour-aloha-hola.md
See test/rename.spec.js for more examples and test/path-parsing.spec.js for hairy details.
Notes
dirname
is the relative path from the base directory set bygulp.src
to the filename.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 abase
option, which can be used to explicitly set the base.gulp.dest()
renames the directories betweenprocess.cwd()
anddirname
(i.e. the base relative to CWD). Usedirname
to rename the directories matched by the glob or descendents of the base of option.
basename
is the filename without the extension likepath.basename(filename, path.extname(filename))
.extname
is the file extension including the.
likepath.extname(filename)
.- when using a function, a second
file
argument is provided with the whole context and original file value. - when using a function, if no
Object
is returned then the passed parameter object (along with any modifications) is re-used.
License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
Found 10/20 approved changesets -- score normalized to 5
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 20 are checked with a SAST tool
Score
3.7
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More