Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Remove overlay json support
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 22, 2011
1 parent 8ee3c3e commit 3024e96
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
34 changes: 0 additions & 34 deletions doc/json.md
Expand Up @@ -389,37 +389,3 @@ 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.

## overlay

npm responds to the `node` and `npm` env-specific package.json values, which
you can hang on the "overlay" key.

For example:

{ "name" : "foo"
, "version" : 7
, "description" : "generic description"
, "overlay" :
{ "node" :
{ "name" : "bar"
, "description" : "description for node"
}
, "npm" :
{ "version" : "1.0.7"
, "description" : "description for npm"
}
, "narwhal" :
{ "description" : "description for narwhal" }
}
}

In this case, this is what npm will treat it as:

{ "name" : "bar"
, "version" : "1.0.7"
, "description" : "description for npm"
}

This way, even if npm is not exactly the same as some other package management
system, you can still use both, and it can be a happy planet.
6 changes: 0 additions & 6 deletions lib/utils/read-json.js
Expand Up @@ -79,12 +79,6 @@ function processJsonString (opts, cb) { return function (er, jsonString) {
return processObject(opts, cb)(er, json)
}}
function processObject (opts, cb) { return function (er, json) {
if (json.overlay) {
;["node", "npm"].forEach(function (k) {
if (!json.overlay[k]) return undefined
for (var i in json.overlay[k]) json[i] = json.overlay[k][i]
})
}

// slashes would be a security risk.
// anything else will just fail harmlessly.
Expand Down

0 comments on commit 3024e96

Please sign in to comment.