Installations
npm install vinyl-paths
Developer Guide
Typescript
No
Module System
ESM
Min. Node Version
>=14.16
Node Version
14.19.3
NPM Version
8.3.2
Score
82
Supply Chain
82.6
Quality
75.5
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
sindresorhus
Download Statistics
Total Downloads
13,037,302
Last Day
1,199
Last Week
5,982
Last Month
58,149
Last Year
997,361
GitHub Statistics
61 Stars
20 Commits
5 Forks
7 Watching
1 Branches
4 Contributors
Bundle Size
684.00 B
Minified
391.00 B
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
5.0.0
Package Id
vinyl-paths@5.0.0
Unpacked Size
3.97 kB
Size
2.04 kB
File Count
4
NPM Version
8.3.2
Node Version
14.19.3
Total Downloads
Cumulative downloads
Total Downloads
13,037,302
Last day
-12.8%
1,199
Compared to previous day
Last week
-53.2%
5,982
Compared to previous week
Last month
-23.5%
58,149
Compared to previous month
Last year
-29%
997,361
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
vinyl-paths
Get the file paths in a
vinyl
stream
Useful when you need to use the file paths from a Gulp pipeline in an async Node.js package.
Simply pass an async function such as del
and this package will provide each path in the stream as the first argument.
Install
1npm install vinyl-paths
Usage
1// gulpfile.js 2import gulp from 'gulp'; 3import stripDebug from 'gulp-strip-debug'; 4import del from 'del'; 5import vinylPaths from 'vinyl-paths'; 6 7// Log file paths in the stream 8export function log() { 9 return gulp.src('app/*') 10 .pipe(stripDebug()) 11 .pipe(vinylPaths(async paths => { 12 console.log('Paths:', paths); 13 }); 14} 15 16// Delete files in the stream 17export function delete() { 18 return gulp.src('app/*') 19 .pipe(stripDebug()) 20 .pipe(vinylPaths(del)); 21} 22 23// Or if you need to use the paths after the pipeline 24export function delete2() { 25 return new Promise((resolve, reject) => { 26 const vp = vinylPaths(); 27 28 gulp.src('app/*') 29 .pipe(vp) 30 .pipe(gulp.dest('dist')) 31 .on('end', async () => { 32 try { 33 await del(vp.paths); 34 resolve(); 35 } catch (error) { 36 reject(error); 37 } 38 }); 39 }); 40}
You should only use a vanilla Node.js package like this if you're already using other plugins in the pipeline, otherwise just use the module directly as gulp.src
is costly. Remember that Gulp tasks can return promises as well as streams!
API
vinylPaths(callback?)
The optional callback will receive a file path for every file and is expected to return a promise. An array of the file paths so far is available as a paths
property on the stream.
callback(path)
Related
- gulp-revert-path - Revert the previous
file.path
change
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
Found 2/20 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
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/vinyl-paths/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/vinyl-paths/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:21
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 2 are checked with a SAST tool
Score
3.5
/10
Last Scanned on 2024-12-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