Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@risadams/gulp-wrapper
Advanced tools
A gulp plugin for wrapping files with custom strings. Access to filename is given through interpolation.
A Gulp plugin for wrapping files with custom strings. Basically
gulp-header
&gulp-footer
together. With the addition that the filename is revealed to the user ( with ${filename} ).
##Usage
For example, on build I can wrap an HTML file with <script>
template tags and specify the filename id. ( angular templates are a good use case )
sample template file
<div>
<span>my template HTML is here</span>
</div>
so in my gulpfile.js
I can do
var gulp = require('gulp'),
wrapper = require('gulp-wrapper');
// ...
gulp.src('template.html')
.pipe(wrapper({
header: '<script type="text/ng-template" id="${filename}">\n',
footer: '</script>\n'
}))
.pipe(gulp.dest('out'));
the result is :
<script type="text/ng-template" id="template.html">
<div>
<span>my template HTML is here</span>
</div>
</script>
##API
####options.header
Type: string
or function
The string
you want to prepend to the file. The file name is available through interpolation ${filename}
//...
gulp.src('script/*.js')
.pipe(wrapper({ header: '/* ${filename} MyCompany 2014 */'}))
A function
that takes file
as argument, and returns the string to be the header.
//...
gulp.src('script/*.js')
.pipe(wrapper({ header: function(file){ return '/* '+ file.path +' MyCompany 2014*/'; } }))
The string
you want to append to the file. The file name is available through interpolation ${filename}
//...
gulp.src('script/*.js')
.pipe(wrapper({ footer: '/* ${filename} MyCompany 2014 */'}))
A function
that takes file
as argument, and returns the string to be the footer.
//...
gulp.src('script/*.js')
.pipe(wrapper({ footer: function(file){ return '/* '+ file.path +' MyCompany 2014*/'; } }))
FAQs
A gulp plugin for wrapping files with custom strings. Access to filename is given through interpolation.
The npm package @risadams/gulp-wrapper receives a total of 217 weekly downloads. As such, @risadams/gulp-wrapper popularity was classified as not popular.
We found that @risadams/gulp-wrapper 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.