]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/read-local-package.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / lib / utils / read-local-package.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/read-local-package.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/read-local-package.js
new file mode 100644 (file)
index 0000000..ca6d613
--- /dev/null
@@ -0,0 +1,12 @@
+exports = module.exports = readLocalPkg
+
+var npm = require("../npm.js")
+  , readJson = require("read-package-json")
+
+function readLocalPkg (cb) {
+  if (npm.config.get("global")) return cb()
+  var path = require("path")
+  readJson(path.resolve(npm.prefix, "package.json"), function (er, d) {
+    return cb(er, d && d.name)
+  })
+}