This Lesson is for Members

Subscribe today and get access to all lessons! Plus direct HD download for offline use, enhances transcripts, member comment forums, and iTunes "podcast" RSS feed. Level up your skills now!

Unlock This Lesson

Already subscribed? Sign In


    Change the level of console output when running npm scripts

    Elijah ManorElijah Manor

    There are times when it is helpful for a npm script to have lots of logs when trying to debug a problem, but there are other times when you want to run a script silently. Thankfully there are a range of flags to control the log level used when running npm scripts.



    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson


    Instructor: 00:02 When running npm scripts, you can pass a range of flags to control the level of log output. For example, we could pass loglevel silent, or instead we could just say, "--silent." For short, we could just say, "-s." You'll notice there's a lot less output in our terminal.

    00:22 The other logging options available, in shorthand form, are -q for quiet, -d for info, -dd for verbose, and -ddd for an extremely silly amount of logs.

    00:36 Let's run npm start again with -ddd. We get lots and lots of logs, which could be helpful if you're trying to track down a problem or you're trying to debug your scripts.