Gathering detailed insights and metrics for gulp-string-replace
Gathering detailed insights and metrics for gulp-string-replace
Gathering detailed insights and metrics for gulp-string-replace
Gathering detailed insights and metrics for gulp-string-replace
Replaces strings on files by using string or regex patterns.
npm install gulp-string-replace
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
22 Stars
49 Commits
5 Forks
2 Watchers
1 Branches
4 Contributors
Updated on Aug 18, 2023
Latest Version
1.1.2
Package Id
gulp-string-replace@1.1.2
Unpacked Size
9.04 kB
Size
3.40 kB
File Count
5
NPM Version
6.4.1
Node Version
8.11.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
Replaces strings in files by using string or regex patterns. Works with Gulp 3!
1npm install gulp-string-replace --save-dev
1var replace = require('gulp-string-replace'); 2 3gulp.task('replace_1', function() { 4 gulp.src(["./config.js"]) // Any file globs are supported 5 .pipe(replace(new RegExp('@env@', 'g'), 'production')) 6 .pipe(gulp.dest('./build/config.js')) 7}); 8 9gulp.task('replace_2', function() { 10 gulp.src(["./index.html"]) 11 .pipe(replace(/version(={1})/g, '$1v0.2.2')) 12 .pipe(gulp.dest('./build/index.html')) 13}); 14 15gulp.task('replace_3', function() { 16 gulp.src(["./config.js"]) 17 .pipe(replace(/foo/g, function () { 18 return 'bar'; 19 })) 20 .pipe(gulp.dest('./build/config.js')) 21});
1gulp.task('replace_1', function() { 2 gulp.src(["./config.js"]) 3 .pipe(replace('environment', 'production')) 4 .pipe(gulp.dest('./build/config.js')) 5});
1gulp.task('replace_1', function() { 2 gulp.src(["./config.js"]) 3 .pipe(replace('environment', function () { 4 return 'production'; 5 })) 6 .pipe(gulp.dest('./build/config.js')) 7}); 8 9gulp.task('replace_2', function() { 10 gulp.src(["./config.js"]) 11 .pipe(replace('environment', function (replacement) { 12 return replacement + '_mocked'; 13 })) 14 .pipe(gulp.dest('./build/config.js')) 15}); 16
1 2var options = { 3 logs: { 4 enabled: false 5 } 6}; 7 8gulp.task('replace_1', function() { 9 gulp.src(["./config.js"]) 10 .pipe(replace('environment', 'dev', options) 11 .pipe(gulp.dest('./build/config.js')) 12}); 13
1 2var options = { 3 searchValue: 'string' 4}; 5 6gulp.task('replace_1', function() { 7 gulp.src(["./config.js"]) 8 .pipe(replace('(some value here /* ignore by sth */)(', 'dev', options) 9 .pipe(gulp.dest('./build/config.js')) 10}); 11
Type: String
or RegExp
The string to search for.
Type: String
or Function
The replacement string or function. Called once for each match. Function has access to regex outcome (all arguments are passed).
Type: Object
Type: string
, Default: regex
, Options: regex
or string
Description: Used to determine if search value is regex or string.
Type: Boolean
, Default: true
Displaying logs.
Type: Boolean
, Default: false
Displaying "not replaced" logs.
More details here: MDN documentation for RegExp and MDN documentation for String.replace.
Task submitted by Tomasz Czechowski. License MIT.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 3/21 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 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 2025-06-30
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