{"_id":"mock-env","_rev":"11-b585c25c5ac645715f7caeeeeab32407","name":"mock-env","description":"morph process.env by adding/chaning/removing env vars for the lifetime of a callback","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.1":{"name":"mock-env","version":"0.1.1","description":"morph process.env by adding/chaning/removing env vars for the lifetime of a callback","main":"index.js","scripts":{"test":"_mocha"},"repository":{"type":"git","url":"https://github.com/burl/mock-env.git"},"keywords":["node","mock","environment","unit","test"],"author":{"name":"Burl","email":"burl+npm@nyswonger.org"},"license":"MIT","bugs":{"url":"https://github.com/burl/mock-env/issues"},"homepage":"https://github.com/burl/mock-env","devDependencies":{"mocha":"^1.21.4"},"_id":"mock-env@0.1.1","_shasum":"0155de99ff0a543bf39e2aa36539346c77a8994c","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"burl.bn","email":"burl+npm@nyswonger.org"},"maintainers":[{"name":"burl.bn","email":"burl+npm@nyswonger.org"}],"dist":{"shasum":"0155de99ff0a543bf39e2aa36539346c77a8994c","tarball":"https://registry.npmjs.org/mock-env/-/mock-env-0.1.1.tgz","integrity":"sha512-8hJRyhufTz4J3OdD4rfSHqYBk+Me/86f4HVcvWSnUAs16tYzcI2Ndouxk6VzcG3V8HVba060RJm1tby0dpRGsw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZE3D+xi2VWdOaImcYvyEjtUJhkqhrBHXVDgfgo7BoGwIhAJ8grVsiPyxAKzy6TtiFFbG7PC+MC9m4bwPx8Ku3OGan"}]}},"0.1.2":{"name":"mock-env","version":"0.1.2","description":"morph process.env by adding/chaning/removing env vars for the lifetime of a callback","main":"index.js","scripts":{"test":"_mocha"},"repository":{"type":"git","url":"https://github.com/burl/mock-env.git"},"keywords":["node","mock","environment","unit","test"],"author":{"name":"Burl","email":"burl+npm@nyswonger.org"},"license":"MIT","bugs":{"url":"https://github.com/burl/mock-env/issues"},"homepage":"https://github.com/burl/mock-env","devDependencies":{"mocha":"^1.21.4"},"_id":"mock-env@0.1.2","_shasum":"dd5988fae485fdb3ad5caf3d91f280db30fd0be2","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"burl.bn","email":"burl+npm@nyswonger.org"},"maintainers":[{"name":"burl.bn","email":"burl+npm@nyswonger.org"}],"dist":{"shasum":"dd5988fae485fdb3ad5caf3d91f280db30fd0be2","tarball":"https://registry.npmjs.org/mock-env/-/mock-env-0.1.2.tgz","integrity":"sha512-PrgDAcsD7N8jzdys13nGAFUQYqijm84FJo6flV0Wt0Ig9R4S+EAWF0TqTdFCfPkvC/tK2kcZ2ksc7O6BE8Mlew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICpnjscIfI6/Z0msHXuKraoIH3VtiDyoF1V0TapQiUCWAiBIfZZSDURSp5KFRW8gVGeP1vmtw7pATTI7yar/ZpSrCA=="}]}},"0.1.3":{"name":"mock-env","version":"0.1.3","description":"morph process.env by adding/chaning/removing env vars for the lifetime of a callback","main":"index.js","scripts":{"test":"_mocha"},"repository":{"type":"git","url":"https://github.com/burl/mock-env.git"},"keywords":["node","mock","environment","unit","test"],"author":{"name":"Burl","email":"burl+npm@nyswonger.org"},"license":"MIT","bugs":{"url":"https://github.com/burl/mock-env/issues"},"homepage":"https://github.com/burl/mock-env","devDependencies":{"mocha":"^1.21.4"},"_id":"mock-env@0.1.3","_shasum":"9427ce6c720da9b55fbbb5dd7aab265def45291f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"burl.bn","email":"burl+npm@nyswonger.org"},"maintainers":[{"name":"burl.bn","email":"burl+npm@nyswonger.org"}],"dist":{"shasum":"9427ce6c720da9b55fbbb5dd7aab265def45291f","tarball":"https://registry.npmjs.org/mock-env/-/mock-env-0.1.3.tgz","integrity":"sha512-4yH4yXI1i++0IpXVSrUQbvZdoF74ptliXW8QTvaGsVqdGZHaQzSx2m8XpK0Ksq4aWTfmOXU6aJY5Fd1V6R651Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqY4Pi8O1Sxb0/lllaveix18wrlosvZqEreuhSReu77gIhANfExNiPJdVlQIE+FAauQe5Q4cHe+SDmTs4t4n/wndHi"}]}},"0.2.0":{"name":"mock-env","version":"0.2.0","description":"morph process.env by adding/chaning/removing env vars for the lifetime of a callback","main":"index.js","scripts":{"test":"_mocha","preversion":"npm test","postversion":"git push && git push --tags"},"repository":{"type":"git","url":"git+https://github.com/burl/mock-env.git"},"keywords":["node","mock","environment","unit","test"],"author":{"name":"Burl","email":"burl+npm@nyswonger.org"},"license":"MIT","bugs":{"url":"https://github.com/burl/mock-env/issues"},"homepage":"https://github.com/burl/mock-env","dependencies":{"has":"^1.0.1"},"devDependencies":{"mocha":"^1.21.4"},"gitHead":"90a2b585c957a08007c3f8e23a257aa416e8e6e1","_id":"mock-env@0.2.0","_shasum":"043f6bbf817cd0d5ca58a6d64e647142adfb353c","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"burl.bn","email":"burl+npm@nyswonger.org"},"maintainers":[{"name":"burl.bn","email":"burl+npm@nyswonger.org"}],"dist":{"shasum":"043f6bbf817cd0d5ca58a6d64e647142adfb353c","tarball":"https://registry.npmjs.org/mock-env/-/mock-env-0.2.0.tgz","integrity":"sha512-YxyMJqs4lBdTB5flHgsmFeGL2cPKW0tnBE93TrbvbKHmQa9MWpDwrofWnWDxcBfBrR13vLgfw5GtfOSeSghu1g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBs5FA5yOsn/xkEwRtiEwRh+aayuH6CVkjIUnPz/Jv51AiBbLyQ1BILOI8uySojWP0pW1qXVUSLhQPh0OBrKbsO02w=="}]},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mock-env-0.2.0.tgz_1497560287929_0.10458640195429325"}}},"readme":"[![Build Status](https://travis-ci.org/burl/mock-env.svg?branch=master)](https://travis-ci.org/burl/mock-env)\n\n# mock-env\n\nmorph process.env by adding/chaning/removing env vars for the lifetime of a callback.\n\nThis is intended for use in unit tests.  It modifies process.env per passed arguments, calls a designated callback, then restores process.env to its original value.\n\nBeware using this in an asynchronous manner.\n\n## Install\n\n```shell\nnpm install mock-env\n```\n\n## Usage Example\n\n```javascript\nvar morph = require('mock-env').morph;\n\nvar result = morph(function() {\n        return process.env['LOGNAME'];\n    }, {\n        LOGNAME: 'someone-else';\n    });\n\n// result will be 'someone-else', not your LOGNAME\n```\n\n## Function\n\n### var result = morph(callback [,setVars={} [,removeVars=[]]])\n\nReturns whatever callback() returns.\n\nCall back 'callback' after morphing process.env by setting (adding or modifying) properties per the setVars object and un setting (deleting)\nany properties named in the removeVars list.\n\noptions:\n\n* `callback` - (required) the callback to invoke in the morphed environment\n* `setVars` - object with zero or more key-value pairs to set in process.env\n* `removeVars` - array of names that should be removed from process.env\n\n# license\n\nMIT\n\n\n","maintainers":[{"name":"burl.bn","email":"burl+npm@nyswonger.org"}],"time":{"modified":"2022-06-20T02:00:38.927Z","created":"2014-10-06T04:32:39.478Z","0.1.1":"2014-10-06T04:32:39.478Z","0.1.2":"2014-10-06T04:47:13.223Z","0.1.3":"2014-10-06T15:52:51.184Z","0.2.0":"2017-06-15T20:58:08.064Z"},"homepage":"https://github.com/burl/mock-env","keywords":["node","mock","environment","unit","test"],"repository":{"type":"git","url":"git+https://github.com/burl/mock-env.git"},"author":{"name":"Burl","email":"burl+npm@nyswonger.org"},"bugs":{"url":"https://github.com/burl/mock-env/issues"},"license":"MIT","readmeFilename":"README.md","users":{}}