]> gerrit.simantics Code Review - simantics/district.git/blob - load-uid.js
3ca79877353519e3f52bb7f07e1f68c29e95022b
[simantics/district.git] / load-uid.js
1 module.exports = loadUid
2
3 var getUid = require("uid-number")
4
5 // Call in the context of a npmconf object
6
7 function loadUid (cb) {
8   // if we're not in unsafe-perm mode, then figure out who
9   // to run stuff as.  Do this first, to support `npm update npm -g`
10   if (!this.get("unsafe-perm")) {
11     getUid(this.get("user"), this.get("group"), cb)
12   } else {
13     process.nextTick(cb)
14   }
15 }