
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
htmlbuild-functions
Advanced tools
Reusable functions for gulp-htmlbuild.
Creates processor that extracts script paths from the block and pipes it to the given stream
as vinyl files (compatible with gulp.src).
Argument cwd is current working directory which script src paths are relative to.
Processor looks for script elements with attribute [data-]min-src, [data-]target-src or src exactly in this order.
Extracting minified version of the script can be disabled by setting min value to false.
var es = require('event-stream'),
concat = require('gulp-concat'),
builders = require('htmlbuild-functions'),
stream = es.through();
gulp.src('index.html')
.pipe(htmlbuild({scripts: builders.streamScript(stream, 'src')}));
return stream
.pipe(concat('scripts.js'))
.pipe(gulp.dest('build');
<!-- htmlbuild:scripts -->
<script src="../bower_components/jquery/dist/jquery.js"
min-src="../bower_components/jquery/dist/jquery.min.js"></script>
<script src="../bower_components/angular/angular.js"
min-src="../bower_components/angular/angular.min.js"></script>
<!-- endbuild -->
Works in same way htmlbuildFunctions.streamScript(stream, cwd, min) does, but unlike the one,
it looks for link elements with attribute [data-]min-href, [data-]target-href or href.
Replaces block with script tag with given src value`.
var htmlbuild = require('gulp-htmlbuild'),
builders = require('htmlbuild-functions');
return gulp.src('index.html')
.pipe(htmlbuild({scripts: builders.replaceScript('scripts.js')}))
.pipe(gulp.dest('build');
<!-- htmlbuild:scripts -->
<script src="../bower_components/jquery/dist/jquery.js"
min-src="../bower_components/jquery/dist/jquery.min.js"></script>
<script src="../bower_components/angular/angular.js"
min-src="../bower_components/angular/angular.min.js"></script>
<!-- endbuild -->
Example above produces index.html with content:
<script src="scripts.js"></script>
Works in same way htmlbuildFunctions.replaceScript(src) does, but produces link tag with href attribute.
FAQs
Reusable functions for gulp-htmlbuild
We found that htmlbuild-functions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.