Many Minds
Published in

Many Minds

Creating Node.js Project using NPM

In this blog, I’m going to show you how to create a basic Node Project.

So the first thing I’m going to do is create the package.json file. I am creating the package.json file manually, but you can also make an automated process to create it.

  • To do this, just type,
npm init
  1. First, it will ask me for a name, and I’m going to click through to use the default, which is the directory name.
  2. Then it’s going to ask me for a version. The default here is 1.0.0. You should be versioning your packages, but this default is how you should start.
  3. Then you’re going to fill in a description, but this isn’t a required field, so you don’t have to.
  4. The entry point is the file that’s loaded when this module is used.
  5. If you don’t have a test command or a git repository, so you can just leave those blank.
  6. You can add keywords that will help people find your package when they’re searching.
  7. Then we get to the author field. The author field should follow a certain structure. The first part should be your name. Then, if you want to, you can include your email address in angle brackets right after that. And if you want to have a website, you can include that in parentheses.
  8. The last prompt is about the license, and I’m just going to accept that default.
  9. Then it will ask me if this package.json that it has created is okay. When I say yes, it goes ahead, and it creates the package.json for me.

If you’re going through this process yourself, you might be concerned about that line up there,

“Error: no test specified”.

Don’t worry about that, this is just a line that gets displayed if someone tries to run tests on your package since there aren’t any specified.

Finally, you will have a package.json file.

That’s it, And this is the basic level Node Project. And You can customize this according to your requirements.




The idea is to learn something for myself and share what I have learned.

Recommended from Medium

Build Your First Web-Application Using MongoDB, Express, Angular and NodeJS (MEAN)

Optional Chaining in Javascript

Angular, Schematics and the Future of TypeWiz

Phone Number Authentication with Reactive Programming

The State of gRPC & RSocket in the browser, JavaScript

7 Important things of JavaScript

Use of should have|could have|and would have Should have, could have, and would have are sometimes…

Clasping the React Hooks — Part 1

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Niluka Sripali Monnankulama

Niluka Sripali Monnankulama

An IT professional with over 3 years of experience. Member of the WSO2 Identity & Access Management Team.

More from Medium

Understanding Local State with React Hooks

Set up a Node.js App with ESLint and Prettier

Implementing User Authentication with Auth0 in React

CRUD app with Node, Express, and MongoDB