1. If it's a website or something, provide a "start" command.
Your package.json file could be something like this:
{ "name" : "my-blog"
, "version" : "1.2.3"
, "dependencies" : { "express" : "*" }
, "scripts" : { "start" : "node my-blog.js" }
}
There are also "stop" and "restart" commands that you can put in
there, if they make sense. These aren't terribly useful at the
moment, since npm doesn't handle pid management and such, but it
provides a consistent hook that can be leveraged automatically in the
future.
2. Regardless of what it is, but especially if it's a library or util
designed for others to use, provide a test command:
{ "name" : "my-tdd-app"
, "version" : "1.2.3"
, "scripts" : { "test" : "make test" }
}
To run the test script, "npm test my-tdd-app".
3. If there are dependencies that are *only* required for testing or
other development scenarios, then list them as "devDependencies",
rather than "dependencies".
{ "name" : "my-express-app"
, "version" : "1.2.3"
, "dependencies" : { "express" : "*" }
, "devDependencies" : { "expresso" : "*"}
, "scripts" : { "test" : "expresso blah blah" }
}
To install the dev dependencies, you can either set the `dev` config
to true, or do `npm install whatever --dev`, or just do `npm link` in
your project dir, and it'll pull in the dev dependencies as well as
the "normal" dependencies.
Some of these things aren't yet very useful, but they're going to be
awesome in the near-ish future, so you should start adding them to
your package now.
--i
--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
I'm not going to execute tests on install, no. In fact, I'm not
entirely sure exactly what it's going to look like long-term, but in
my foggy imaginings of the future, I see a CI system where brave
volunteers can install and test packages, and automatically upload
their results. Then, we can gather information about package
stability and worth, and have some heuristics that can help people
decide which piece of software is best for their needs.
The "test" script will be a bit part of making all that work. It will
probably not be until well after a 1.0.0 release, I'm sure.
On Thu, Oct 28, 2010 at 13:02, Nathan Rajlich <nat...@tootallnate.net> wrote:
> is devDependencies new? That's a feature I've been wanting!!
No, it's been sitting quietly in `npm help json` for a while now.
--i