Gathering detailed insights and metrics for gulp-flatten
Gathering detailed insights and metrics for gulp-flatten
Gathering detailed insights and metrics for gulp-flatten
Gathering detailed insights and metrics for gulp-flatten
@types/gulp-flatten
TypeScript definitions for gulp-flatten
gulp-concat-flatten
A Gulp plugin to recursively flatten directories and concatenate the files within
gulp-flatten-requires
Flattens relative require('./path/<module>') calls to require('./<module>')
@ryancavanaugh/gulp-flatten
Type definitions for gulp-flatten from https://www.github.com/DefinitelyTyped/DefinitelyTyped
npm install gulp-flatten
Typescript
Module System
Min. Node Version
Node Version
NPM Version
98.7
Supply Chain
97.1
Quality
73.2
Maintenance
100
Vulnerability
100
License
JavaScript (99.68%)
CSS (0.32%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
107 Stars
52 Commits
13 Forks
4 Watchers
2 Branches
5 Contributors
Updated on Feb 05, 2025
Latest Version
0.4.0
Package Id
gulp-flatten@0.4.0
Size
19.57 kB
NPM Version
5.5.1
Node Version
9.3.0
Published on
Dec 31, 2017
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
6
Remove or replace relative path for files (gulp v3).
npm install gulp-flatten
Example source directory with bower compoments:
├── angular
│ ├── README.md
│ ├── angular-csp.css
│ ├── angular.js
│ ├── angular.min.js
│ └── bower.json
├── angular-route
│ ├── README.md
│ ├── angular-route.js
│ ├── angular-route.min.js
│ ├── angular-route.min.js.map
│ └── bower.json
├── angular-sanitize
│ ├── README.md
│ ├── angular-sanitize.js
│ ├── angular-sanitize.min.js
│ ├── angular-sanitize.min.js.map
│ └── bower.json
└── bootstrap
├── DOCS-LICENSE
├── LICENSE
├── LICENSE-MIT
├── README.md
├── bower.json
└── dist
├── css
│ ├── bootstrap-theme.css
│ ├── bootstrap-theme.min.css
│ ├── bootstrap.css
│ └── bootstrap.min.css
├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ └── glyphicons-halflings-regular.woff
└── js
├── bootstrap.js
└── bootstrap.min.js
By default gulp
stores files with it's relative paths. To copy all minified javascript files from bower_components
to build
folder without relative paths:
1var flatten = require('gulp-flatten'); 2 3gulp.src('bower_components/**/*.min.js') 4 .pipe(flatten()) 5 .pipe(gulp.dest('build/js'));
Result will be list of all .min.js
files inside build/js
dir:
build
└── js
├── angular-route.min.js
├── angular-sanitize.min.js
├── angular.min.js
└── bootstrap.min.js
Type: String
Default: ''
Relative path for file.
Type: Number
or Array
of two numbers
If passed in as positive number, it will include the number of top-level parents in the output. Using this code:
1gulp.src(['bower_components/**/*.css']) 2 .pipe(flatten({ includeParents: 1} )) 3 .pipe(gulp.dest('build/'));
will create this structure (from sample directory tree above):
└── bootstrap
├── bootstrap-theme.css
├── bootstrap-theme.min.css
├── bootstrap.css
└── bootstrap.min.css
If passed in as negative number, it will include the number of bottom-level parents in the output. Using this code:
1gulp.src(['bower_components/**/*.css']) 2 .pipe(flatten({ includeParents: -1} )) //or indludeParents: [0, 1] 3 .pipe(gulp.dest('build/'));
will create this structure:
└── css
├── bootstrap-theme.css
├── bootstrap-theme.min.css
├── bootstrap.css
└── bootstrap.min.css
If passes as array of two numbers, both parents from top and bottom will be kept in resulting path of a file.
1gulp.src(['bower_components/**/*.css']) 2 .pipe(flatten({ includeParents: [1, 1]} )) 3 .pipe(gulp.dest('build/'));
will create this structure:
└── bootstrap
└── css
├── bootstrap-theme.css
├── bootstrap-theme.min.css
├── bootstrap.css
└── bootstrap.min.css
Type: Number or Array of two Numbers [begin, end]
This options applies Array.slice
to the array of path elements and allows you
to receive a subsequences of the path.
1gulp.src(['bower_components/**/*.css']) 2 .pipe(flatten({ subPath: [1, 1]} )) 3 .pipe(gulp.dest('build/'));
This as an example would flatten top1/top2/bottom2/bottom1/file.txt
to top2/file.txt
.
[1, -1]
would flatten top1/top2/bottom2/bottom1/file.txt
to top2/bottom2/file.txt
.
Please refer to the Array.slice documentation for a detailed description.
! If you're using both options.includeParents
combined with options.subPath
please note that options.includeParents
is applied first.
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 3/17 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
Reason
21 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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