sindresorhus / gulp-size

Display the size of your project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get the size value

vladshcherbin opened this issue · comments

Hello, how can I get the size value ?
E.g. output with gulp-notify. Smth like size().value.

Is it possible ?

Do you want the size of individual files or total?

The total value.
I compile sass, concat js files and have a notification after it is done. So, I wanted to add a string with the size of the output file to the notification in order not to open the terminal. Is it possible somehow?

thanks for fast help, can you please confirm it is working

my gulp

gulp.task('test', function () {
    var s = size();
    gulp.src('test.js')
        .pipe(s)
        .pipe(gulp.dest('dist'))
        .pipe(notify({
            onLast: true,
            message: 'Total file size ' + s.prettySize
        }));
});

and the output is undefined

Using gulpfile ~/Sites/test/gulpfile.js
Starting 'test'...
Finished 'test' after 24 ms
all files 34 B
gulp-notify: [Gulp notification] Total file size undefined

gulp-notify 2.1.0
gulp-size 1.2.0

Sorry, did a mistake in the example. Fixed in 6db66e9.

Yes, works like a charm now.
The response and the fixes are blazingly fast, you is awesome, thank you for your work!

What a coincidence, googled this issue and after almost 1 year this seems to be an issue again.

size().size => undefined
size().prettySize => undefined

var s = size();
s.size => undefined
s.prettySize => undefined