在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):sindresorhus/gulp-size开源软件地址(OpenSource Url):https://github.com/sindresorhus/gulp-size开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-size
Logs out the total size of files in the stream and optionally the individual file-sizes. Install
Usageconst gulp = require('gulp');
const size = require('gulp-size');
exports.default = () => (
gulp.src('fixture.js')
.pipe(size())
.pipe(gulp.dest('dist'))
); APIsize(options?)optionsType: titleType: Give it a title so it's possible to distinguish the output of multiple instances logging at once. gzipType: Displays the gzipped size. brotliType: Displays the brotli compressed size. uncompressedType: Displays the uncompressed size. prettyType: Displays prettified size: showFilesType: Displays the size of every file instead of just the total size. showTotalType: Displays the total of all files. size.sizeType: The total size of all files in bytes. size.prettySizeType: Prettified version of ExampleYou could, for example, use this to report the total project size with const gulp = require('gulp');
const size = require('gulp-size');
const notify = require('gulp-notify');
exports.default = () => {
const s = size();
return gulp.src('fixture.js')
.pipe(s)
.pipe(gulp.dest('dist'))
.pipe(notify({
onLast: true,
message: () => `Total size ${s.prettySize}`
}));
}; |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论