Anton Rudeshko
Anton Rudeshko

Reputation: 1137

What should one put into npm package?

Recently I start committing my application node_modules folder into VCS to speed up deployments and fix dependencies.

I noticed that many npm packages contain a bunch of stuff unnecessary to me like tests and various builds that I'll never use and I wrinkle every time when I put it in my repo.

So, what should one put into npm package?

Upvotes: 2

Views: 200

Answers (1)

Thot
Thot

Reputation: 799

The tests and other items are usually a good item to include in your devDependencies.

You can install packages without them by using npm install --production or setting the configuration flag to production using npm config set production

I would recommend looking at this page and reading the information in the different types of dependencies to get an understanding of what each does.

That being said the bare minimum to include is just what it takes for your module to run but that varies based on the module you're creating. Although a README.md is almost essential if you're sharing your package publicly so users can git a quick overview of your package on npm and github.

Upvotes: 2

Related Questions