]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/load-uid.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / lib / config / load-uid.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/load-uid.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/load-uid.js
new file mode 100644 (file)
index 0000000..3ca7987
--- /dev/null
@@ -0,0 +1,15 @@
+module.exports = loadUid
+
+var getUid = require("uid-number")
+
+// Call in the context of a npmconf object
+
+function loadUid (cb) {
+  // if we're not in unsafe-perm mode, then figure out who
+  // to run stuff as.  Do this first, to support `npm update npm -g`
+  if (!this.get("unsafe-perm")) {
+    getUid(this.get("user"), this.get("group"), cb)
+  } else {
+    process.nextTick(cb)
+  }
+}