Gathering detailed insights and metrics for gulp-rename
Gathering detailed insights and metrics for gulp-rename
Gathering detailed insights and metrics for gulp-rename
Gathering detailed insights and metrics for gulp-rename
npm install gulp-rename
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.8
Supply Chain
88.2
Quality
81.2
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
303,487,160
Last Day
73,838
Last Week
555,845
Last Month
2,651,623
Last Year
32,594,087
692 Stars
97 Commits
73 Forks
16 Watching
1 Branches
19 Contributors
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
Cumulative downloads
Total Downloads
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
7
gulp-rename is a gulp plugin to rename files easily.
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.
dirname
is the relative path from the base directory set by gulp.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 a base
option, which can be used to explicitly set the base.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.basename
is the filename without the extension like path.basename(filename, path.extname(filename))
.extname
is the file extension including the .
like path.extname(filename)
.file
argument is provided with the whole context and original file value.Object
is returned then the passed parameter object (along with any modifications) is re-used.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
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
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
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