Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2010-03-05 08:18:04 +0300
committerisaacs <i@izs.me>2010-03-05 08:18:04 +0300
commit6efe1ad0b7f65ca4ddc08ab393558c95f65d505a (patch)
tree04e30748c53f52c5338302894555dfc86c197bb9 /README.md
parent74d2551157bef16809544f916bf94c586a09a253 (diff)
Add documentation for the "engines" field.
Diffstat (limited to 'README.md')
-rw-r--r--README.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/README.md b/README.md
index 441ec0889..0ca9e6aa8 100644
--- a/README.md
+++ b/README.md
@@ -205,6 +205,22 @@ This would link the dependencies into the specified locations, so that the packa
<strong style="color:red">Warning!</strong> This is currently the *only* way in which npm modifies the pristine nature of the package directory, and it may go away eventually. It's just that it satisfies a use case that is pretty tricky to do otherwise.
+### engines
+
+Packages/1.0 says that you can have an "engines" field with an array of engine names. However, it has no provision for specifying which version of the engine your stuff runs on.
+
+With npm, you can use either of the following styles to specify the version of node that your stuff works on:
+
+ { engines: ["node >=0.1.27 <0.1.30"] }
+
+or:
+
+ {engines:{"node":">=0.1.27 <0.1.30"}}
+
+And, like with dependencies, if you don't specify the version (or if you specify "*" as the version), then any version of node will do.
+
+If you specify an "engines" field, then npm will require that "node" be somewhere on that list. If "engines" is omitted, then npm will just assume that it works on node.
+
## Todo
All the "core functionality" stuff above. Most immediately: