Code Monkey home page Code Monkey logo

Comments (6)

sindresorhus avatar sindresorhus commented on June 7, 2024

Do you want the size of individual files or total?

from gulp-size.

vladshcherbin avatar vladshcherbin commented on June 7, 2024

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?

from gulp-size.

vladshcherbin avatar vladshcherbin commented on June 7, 2024

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

from gulp-size.

sindresorhus avatar sindresorhus commented on June 7, 2024

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

from gulp-size.

vladshcherbin avatar vladshcherbin commented on June 7, 2024

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

from gulp-size.

dvlden avatar dvlden commented on June 7, 2024

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

from gulp-size.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.