If you put a package.json file in your project (which is a great way to automatically link in your deps with npm, even if you don't plan on publishing it for others to use), and you should do the following:
1. If it's a website or something, provide a "start" command.
Your package.json file could be something like this:
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:
3. If there are dependencies that are *only* required for testing or other development scenarios, then list them as "devDependencies", rather than "dependencies".
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.
> 2. Regardless of what it is, but especially if it's a library or util
> designed for others to use, provide a test command:
Just updated node-mysql. One question about testing so:
Are you planning to execute these tests when installing a package in
the future? If so, it would probably be wise to only run tests that
are independent of environment (think database credentials), right?
--fg
On Oct 28, 9:19 pm, Isaac Schlueter <i...@izs.me> wrote:
> If you put a package.json file in your project (which is a great way
> to automatically link in your deps with npm, even if you don't plan on
> publishing it for others to use), and you should do the following:
> 1. If it's a website or something, provide a "start" command.
> Your package.json file could be something like this:
> 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:
> 3. If there are dependencies that are *only* required for testing or
> other development scenarios, then list them as "devDependencies",
> rather than "dependencies".
> 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.
On Thu, Oct 28, 2010 at 2:19 PM, Isaac Schlueter <i...@izs.me> wrote: > If you put a package.json file in your project (which is a great way > to automatically link in your deps with npm, even if you don't plan on > publishing it for others to use), and you should do the following:
> 1. If it's a website or something, provide a "start" command.
> Your package.json file could be something like this:
> 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:
> 3. If there are dependencies that are *only* required for testing or > other development scenarios, then list them as "devDependencies", > rather than "dependencies".
> 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 nodejs@googlegroups.com. > To unsubscribe from this group, send email to > nodejs+unsubscribe@googlegroups.com<nodejs%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en.
On Thu, Oct 28, 2010 at 2:42 PM, Ryan Gahl <ryan.g...@gmail.com> wrote: > Wasn't there a nifty site (or github Pages site) for npm once, with a > groovy ASCII-lookin logo? and more docs?
On Thu, Oct 28, 2010 at 12:43 PM, Ryan Gahl <ryan.g...@gmail.com> wrote: > Nevermind on the "more docs" thing... found plenty. :)
> On Thu, Oct 28, 2010 at 2:42 PM, Ryan Gahl <ryan.g...@gmail.com> wrote:
>> Wasn't there a nifty site (or github Pages site) for npm once, with a >> groovy ASCII-lookin logo? and more docs?
>> Or was that just in a dream I had?
> -- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com. > To unsubscribe from this group, send email to > nodejs+unsubscribe@googlegroups.com<nodejs%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en.
2010/10/28 Felix Geisendörfer <fe...@debuggable.com>:
> Are you planning to execute these tests when installing a package in > the future?
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.