Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
gulp-token-replace
Advanced tools
A token replace plugin for gulp 3
First, install gulp-token-replace
as a development dependency:
npm install --save-dev gulp-token-replace
Add it to your gulpfile.js
:
var replace = require('gulp-token-replace');
gulp.task('token-replace', function(){
var config = require('./configuration/config.json');
return gulp.src(['src/*.js', 'src/*.html'])
.pipe(replace({global:config}))
.pipe(gulp.dest('dist/'))
});
module.exports = {
"tokens":{
"RMLibs":"http://ads.pictela.com/ads/jsapi/ADTECH.js",
"size":"320x50",
"Copyrights":"Copyright 2010-2014 AOL Platforms.",
"Author":"Martin Wojtala"
},
"main":{
"name":"example",
"title":"EXAMPLE TITLE"
}
};
In a file (also works for JavaScript)
<!--{{tokens.Copyrights}}-->
<!--canvasSize:{{tokens.size}}-->
<!DOCTYPE html>
<html lang="en">
<head><title>{{main.title}}</title>
<meta http-equiv="X-UA-Compatible" content="IE=9">
<meta charset="UTF-8">
<script src="{{tokens.RMLibs}}"></script>
<script src="swipe.min.js"></script>
<link rel="stylesheet" href="{{main.name}}.css">
<script src="{{main.name}}.debug.js"></script>
</head>
<body>
<div id="content"></div>
<div id="debug"></div>
</body>
</html>
gulp-token-replace can be called with a config object with these attributes:
{{main.css}}
or {{styles/main.css}}
can be used.Type: Object
configuration object.
Note: gulp-token-replace cannot perform regex replacement on streams.
FAQs
A token replace plugin for gulp
The npm package gulp-token-replace receives a total of 4,052 weekly downloads. As such, gulp-token-replace popularity was classified as popular.
We found that gulp-token-replace demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.