Wolfgaung
Wolfgaung

Reputation: 53

Where to put package in package.json? dependency or devdependency

Just a short question.

I develop a api in node & express where i need the package request for my tests and for the api logic itself. Should i put it in the normal dependencies or in the dev dependencies. Or even in both of them? Thx.

Upvotes: 1

Views: 139

Answers (2)

Wolfgaung
Wolfgaung

Reputation: 53

it seems to be ok, to add it to the dependencies as well as to the devDependencies. So now "npm install --dev" installs only the dependecies for the tests and "npm install" installs everything.

Upvotes: 0

eavidan
eavidan

Reputation: 5564

In general, dependencies is used for packages your package depends on to run (and be used), whiledevDependencies for packages needed to develop it.

In your case, dependencies sounds right.

Anyway, when developing an app it is mostly for semantics - this only really matters when developing libraries and reusable components.

Upvotes: 1

Related Questions