Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson

Already subscribed? Sign In

Autoplay

    Set default values for package.json using npm set

    Mark ShustMark Shust

    Npm by default uses global values when initializing a new package.json file. Learn how to set your own global default values by command line or editing the ~/.npmrc file.

    npmnpm
    Code

    Code

    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
    Transcript

    Transcript

    Instructor: 00:00 Initializing an npm package.json file uses global defaults. Most of the time you'll want to have the same author and license for all of your projects. Let's set some defaults for us to use.

    00:13 Npm set init followed by the property you want to define. Here we will set a license, author email, and author name. Let's initialize this repo again.

    00:29 We can see that the new initialization was created from the global properties we just defined. You can also see that these values can be edited manually by opening up the hidden npmrc file from your home directory, then editing and saving the file.

    Discuss

    Discuss