Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm new Node.js development and I have a question about best practices when writing package.json files.

From my understanding, you have to list all devependences that you need to execute your app under "dependencies" in the package.json file. All your extra dependences that are required to run your test (or your build process) have to be listed in "devDependencies".

But what about tools that you additionally use, but which are not necessarily required by every developer. Take the node-inspector package as an example, which I installed globally on my machine but did not add to the package.json file.

Is that a good practice, or would you recommend to also file those packages as "devDependencies"?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

devDependencies are packages you need in order to work on your project. Testing frameworks used in the project, mock APIs, CSS preprocessors (if you don't ship a compiled version) fit here.

node-inspector is not needed for you to run tests and make changes to parts of your code, so it should not be included in the package. Other users might use different debuggers.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.