Shaun Luttin Shaun Luttin - 1 month ago 5x
Node.js Question

Where do we save demo app dependencies when buiding a module?

I am building my first node module. Inside the module there is a demo application. The demo is only useful during development. Where do we put the demo's dependencies?

The first answer that comes to mind, is to put them into

, because they are only useful during development. That being said, usually I reserve
for build tools not for modules that run the (demo) app.

So the question is, when developing a module that contains its own demo app, where does one put the demo app's dependencies?

  • dependencies

  • devDependencies

  • someWhereElse

This is the module:

Here is a high-level graph of the dependencies in my module. The locations in
are based on the answer from Pranesh.

third-party-modules (optionalDependencies)
third-party-modules (dependencies)

When someone installs our module, we want them only to pull down
. When someone clones our repo, we want them top be able to also pull down


In most cases, demo apps will be dependent on the module you build, aurelia-open-id-connect in your case. If you have any other dependencies for the demo app other than your module, it should come under optionalDependencies.

Refer this

These modules should be installed with -O option. Example, npm i express -O