{"author":{"name":"Brandon Benvie","email":"brandon@bbenvie.com","url":"http://bbenvie.com"},"name":"environment","description":"Provides node's `process.env` object functionality as stand-alone functions instead of a C++ fake object that does weird things. As an added bonus, if running node with Proxies enabled (\"node --harmony\") it also exports a function that creates an `Environment` object that is similar to `process.env` but behaves like a real object.","version":"0.0.1","keywords":["env","environment","process.env"],"homepage":"https://github.com/Benvie/node-environment","repository":{"type":"git","url":"git://github.com/Benvie/node-environment.git"},"main":"environment.js","scripts":{"install":"node-gyp rebuild"},"gypfile":true,"readme":"# Environment\n\nProvides node's `process.env` object functionality as stand-alone functions instead of a C++ fake object that does weird things. As an added bonus, if running node with Proxies enabled (\"node --harmony\") it also exports a function that creates an `Environment` object that is similar to `process.env` but behaves like a real object.\n\n# Install\n\n\t\tnpm install environment\n\n# Use\nMostly self-explanatory:\n\n* __environment.get(key)__\n* __environment.set(key, value)__\n* __environment.delete(key)__\n* __environment.enumerate()__\n\n# Environment object\nIf `Proxy` is available, due to running node using the `--harmony` flag, a constructor is exported as well which allows the creation of `Environment` objects.\n\nThese objects aren't entirely normal JavaScript objects, but they're much closer than node's `process.env`. `Environment.prototype` doesn't inherit from `Object.prototype` but it does have most of the functions from it. `toString`, `valueOf`, `isPrototypeOf`, `hasOwnProperty`, as well as `constructor` pointing to `Environment`.\n\nIt's possible to add methods to `Environment.prototype` and have them work on instances correctly. It's possible to change an instance's `__proto__` and point it to something else and also have that work correctly (though Object.getPrototypeOf may not reflect the change).\n\n```javascript\n// normal creation\nvar env = require('environment').create();\n```\n```javascript\n// or modifying the prototype\nvar Environment = require('environment');\nEnvironment.prototype.paths = function paths(){\n\treturn this.PATH.split(process.platform === 'win32' ? ';' : ':');\n}\n\nvar env = new Environment;\nconsole.log(env.paths());\n```\n","_id":"environment@0.0.1","dist":{"shasum":"1be6c909e06f63b21ff7248af0bc012ffe64b4a0","tarball":"http://registry-npm.ywwl.com/environment/download/environment-0.0.1.tgz","integrity":"sha512-cr7wZlIoKAltYJqyc8LhegPUtCt2VWgRGi13kFB7YlSsmh4G0ESfY6D+s56OtZoGW2WeJt5AGdQHTKv/bIN6JA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQxpE0c3a9BtqZPcQEVlEAoiLdy9H4OSMmLM5YK5H9QwIgH/3j+ntI5RSo2H8oTggNwer5xtbETtmDHba+UuD2wEc="}],"size":35990,"noattachment":false,"key":"/environment/-/environment-0.0.1.tgz"},"maintainers":[{"name":"benvie","email":"brandon@bbenvie.com"}],"directories":{},"publish_time":1340838588666,"_cnpm_publish_time":1340838588666,"dist-tags":{"latest":"1.1.0"}}