Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Display the size of your project

License

NotificationsYou must be signed in to change notification settings

sindresorhus/gulp-size

Display the size of your project

Logs out the total size of files in the stream and optionally the individual file-sizes.

Install

npm install --save-dev gulp-size

Usage

importgulpfrom'gulp';importsizefrom'gulp-size';exportdefault()=>(gulp.src('fixture.js').pipe(size()).pipe(gulp.dest('dist')));

API

size(options?)

options

Type:object

title

Type:string
Default:''

Give it a title so it's possible to distinguish the output of multiple instances logging at once.

gzip

Type:boolean
Default:false

Displays the gzipped size.

brotli

Type:boolean
Default:false

Displays the brotli compressed size.

uncompressed

Type:boolean
Default:false if either of gzip or brotli istrue, otherwisetrue

Displays the uncompressed size.

pretty

Type:boolean
Default:true

Displays prettified size:1337 B1.34 kB.

showFiles

Type:boolean
Default:false

Displays the size of every file instead of just the total size.

showTotal

Type:boolean
Default:true

Displays the total of all files.

size.size

Type:number
Example:12423000

The total size of all files in bytes.

size.prettySize

Type:string
Example:14 kB

Prettified version of.size.

Example

You could, for example, use this to report the total project size withgulp-notify:

importgulpfrom'gulp';importsizefrom'gulp-size';importnotifyfrom'gulp-notify';exportdefault()=>(exports.default=()=>{constsizeInstance=size();returngulp.src('fixture.js').pipe(sizeInstance).pipe(gulp.dest('dist')).pipe(notify({onLast:true,message:()=>`Total size${sizeInstance.prettySize}`}));};

About

Display the size of your project

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors10


[8]ページ先頭

©2009-2025 Movatter.jp