1 if (module !== require.main) {
2 throw new Error("This file should not be loaded with require()")
5 if (!process.getuid || !process.getgid) {
6 throw new Error("this file should not be called without uid/gid support")
9 var argv = process.argv.slice(2)
10 , user = argv[0] || process.getuid()
11 , group = argv[1] || process.getgid()
13 if (!isNaN(user)) user = +user
14 if (!isNaN(group)) group = +group
16 console.error([user, group])
21 console.log(JSON.stringify({uid:+process.getuid(), gid:+process.getgid()}))
23 console.log(JSON.stringify({error:ex.message,errno:ex.errno}))