This document is still work in progress.
Please check the mailing list archives for the latest discussions about it.
Debian JavaScript Policy
This page describes the policy that packages with Javascript libraries should follow.
Package naming
Given a foo library, packages must be named according to the following rules:
if the library is usable from within a web-browser, the binary package name must be called libjs-foo, and the source package name should be called foo.js;
if the library is usable from within the NodeJS framework, the binary package name must be called node-foo, and the source package name should be called the same;
if the library is usable both from a web-browser and from NodeJS, it should generate two binary packages, each called as described above.
Please remember that it's preferable if you name the repository after the source package name (i.e. foo.js.git for foo.js and node-foo.git for node-foo). This isn't a hard requirement though.
Paths
libjs-foo
The scripts should be installed to /usr/share/javascript/foo/.
node-foo
The scripts should be installed to /usr/lib/nodejs/ or /usr/lib/nodejs/foo/. The choice depends whether the module is contained in a single file or in multiple files. In case the latter is true, please refer to the upstream documentation (also available in /usr/share/doc/nodejs/api/modules.html#folders_as_Modules) to understand how to correctly make it available to the NodeJS framework.
Binary rename of node to nodejs
The program name "node" is conflicting with another package. Technical committee decided to fix this by renaming node to nodejs. To comply to this, it is often as simple as :
Depends nodejs (>= 0.6.19~dfsg1-3~)
- change shebangs to #!/usr/bin/nodejs
- rename node to nodejs in makefiles
- do not depend on nodejs-legacy
Some programs are a bit less obvious to fix, for example they can spawn nodejs instances using "node" name.