Gathering detailed insights and metrics for gulp-dom-src
Gathering detailed insights and metrics for gulp-dom-src
Gathering detailed insights and metrics for gulp-dom-src
Gathering detailed insights and metrics for gulp-dom-src
Create a gulp stream from script, link, or any set of tags in an HTML file.
npm install gulp-dom-src
Typescript
Module System
NPM Version
62.1
Supply Chain
88.3
Quality
69.4
Maintenance
25
Vulnerability
80
License
JavaScript (89.64%)
HTML (10.36%)
Total Downloads
171,432
Last Day
1
Last Week
105
Last Month
418
Last Year
7,706
MIT License
41 Stars
15 Commits
8 Forks
5 Watchers
1 Branches
2 Contributors
Updated on Sep 23, 2021
Minified
Minified + Gzipped
Latest Version
0.2.0
Package Id
gulp-dom-src@0.2.0
Size
4.23 kB
NPM Version
1.5.0-alpha-1
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-8.7%
105
Compared to previous week
Last Month
-50.1%
418
Compared to previous month
Last Year
41.1%
7,706
Compared to previous year
3
Create a gulp stream from script, link, or any set of tags in an HTML file.
1var gulp = require('gulp'); 2var domSrc = require('gulp-dom-src'); 3var concat = require('gulp-concat'); 4var uglify = require('gulp-uglify'); 5 6gulp.task('default', function () { 7 domSrc({ file: 'index.html', selector: 'script', attribute: 'src' }) 8 .pipe(concat('app.full.min.js')) 9 .pipe(uglify()) 10 .pipe(gulp.dest('dist/')); 11});
Type: String
The name of the HTML file to read the tags from.
Type: String
Any valid CSS selector. You can use complex selectors to allow flexible include/exclude logic for your tags. For example, use a selector such as script[data-concat!="false"]
and put data-concat="false"
on any script tags you wish to exclude from a concat/minification stream.
Type: String
The name of the attribute that contains the file path. Typically src
for script
tags and href
for link
s.
Type: String
(Optional)
The directory where the paths in your tags are relative to. By default, the files references in your script or link tags are assumed to be relative to the HTML file they're read from.
Type: Object
(Optional)
Default: {}
Options passed through to the underlying vinyl-fs
. Can include options like read
and buffer
.
Creates a stream that html files can be piped into -- html files in, script or style files out.
See above
Combine gulp-dom-src with gulp-cheerio for a full concat & min workflow.
1var gulp = require('gulp'); 2var domSrc = require('gulp-dom-src'); 3var concat = require('gulp-concat'); 4var cssmin = require('gulp-cssmin'); 5var uglify = require('gulp-uglify'); 6var cheerio = require('gulp-cheerio'); 7 8gulp.task('css', function() { 9 return domSrc({file:'index.html',selector:'link',attribute:'href'}) 10 .pipe(concat('app.full.min.css')) 11 .pipe(cssmin()) 12 .pipe(gulp.dest('dist/')); 13}); 14 15gulp.task('js', function() { 16 return domSrc({file:'index.html',selector:'script',attribute:'src'}) 17 .pipe(concat('app.full.min.js')) 18 .pipe(uglify()) 19 .pipe(gulp.dest('dist/')); 20}); 21 22gulp.task('indexHtml', function() { 23 return gulp.src('index.html') 24 .pipe(cheerio(function ($) { 25 $('script').remove(); 26 $('link').remove(); 27 $('body').append('<script src="app.full.min.js"></script>'); 28 $('head').append('<link rel="stylesheet" href="app.full.min.css">'); 29 })) 30 .pipe(gulp.dest('dist/')); 31});
cwd
option.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/10 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-23
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