Skip to content

Instantly share code, notes, and snippets.

@Flaque
Created January 21, 2020 21:13
Show Gist options
  • Save Flaque/df4e8676c243507cdd2a69b2c3610647 to your computer and use it in GitHub Desktop.
Save Flaque/df4e8676c243507cdd2a69b2c3610647 to your computer and use it in GitHub Desktop.

Hey folks

This is a small overview of common Javascript tools.

What's npm?

NPM is the "node package manager". It's a command-line tool you use to download code that other people wrote that you can use in your own projects.

package.json is a config file

It reads from a package.json file that contains a bunch of "dependencies" (code other people wrote) that looks like this:

{
  "dependencies": {
    "firebase": "^7.6.1",
    "react": "^16.12.0",
    "next": "latest",
  }
}

npm install automatically installs stuff for you

When you first try to use a javascript project, it'll likely ask you to run this:

npm install

This will download those dependencies from the internet and store them on your computer in the correct place. This is much better than having to download a zip file and installing it yourself!

npm run <thing> runs a command for you

Some projects, like nextjs projects, have their own commands for "starting" your app. npm is often used to run these commands for you.

Some common commands look like:

npm run dev  # starts the app on your computer 
npm run test # runs any tests 
npm run fmt  # formats your code 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment