node package manager



generate node packages with simple xml!


first, write a sensible configuration file, like:

<?xml version='1.0' encoding='UTF-8' ?>
<package xmlns="" name="npml" version="0.1.0">
  <author email="">jden</author>
  <description>generate node packages with simple xml!</description>
    <keyword>the best</keyword>
    <keyword>so extensible</keyword>
    <keyword>very markup</keyword>
    <keyword>such enterprise</keyword>
    <script name="test">mocha</script>
    <script name="start">node index.js</script>
    <dependency name="cheerio" version="^0.16.0" />
    <dependency name="through2" version="^0.5.1" />
    <dependency name="chai" version="^1.9.1" />
    <dependency name="mocha" version="^1.19.0" />
    <dependency name="concat-stream" version="^1.4.6" />

Now wouldn't it be awesome if npm just let you use that directly? Sadly, it doesn't - but that's where npml comes it! With this tool, you can write the xml you love while automatically generating the fragile, application-specific format used by package.json.

So, once we have the above xml, we can automatically generate that package.json file like so:

$ cat package.xml | npml > package.json

The advantages of this technique are obvious, but the main one is worth calling out: you get to continue to use your full xml toolchain, so it's easy to generate, validate, and transform package configurations coming from any environment. And since it's xml, you can extend it with your own tags and formats if you want.


$ npm install -g npml

running the tests

From package root:

$ npm install
$ npm test



ISC. (c) MMXIV jden See