Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
gulp-size
Advanced tools
Readme
Display the size of your project
Logs out the total size of files in the stream and optionally the individual file-sizes.
npm install --save-dev gulp-size
import gulp from 'gulp';
import size from 'gulp-size';
export default () => (
gulp.src('fixture.js')
.pipe(size())
.pipe(gulp.dest('dist'))
);
Type: object
Type: string
Default: ''
Give it a title so it's possible to distinguish the output of multiple instances logging at once.
Type: boolean
Default: false
Displays the gzipped size.
Type: boolean
Default: false
Displays the brotli compressed size.
Type: boolean
Default: false
if either of gzip or brotli is true
, otherwise true
Displays the uncompressed size.
Type: boolean
Default: true
Displays prettified size: 1337 B
→ 1.34 kB
.
Type: boolean
Default: false
Displays the size of every file instead of just the total size.
Type: boolean
Default: true
Displays the total of all files.
Type: number
Example: 12423000
The total size of all files in bytes.
Type: string
Example: 14 kB
Prettified version of .size
.
You could, for example, use this to report the total project size with gulp-notify
:
import gulp from 'gulp';
import size from 'gulp-size';
import notify from 'gulp-notify';
export default () => (
exports.default = () => {
const sizeInstance = size();
return gulp.src('fixture.js')
.pipe(sizeInstance)
.pipe(gulp.dest('dist'))
.pipe(notify({
onLast: true,
message: () => `Total size ${sizeInstance.prettySize}`
}));
};
FAQs
Display the size of your project
The npm package gulp-size receives a total of 21,832 weekly downloads. As such, gulp-size popularity was classified as popular.
We found that gulp-size demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.