{
  "name": "with",
  "version": "4.0.3",
  "description": "Compile time `with` for strict mode JavaScript",
  "main": "index.js",
  "scripts": {
    "test": "mocha test/index.js -R spec"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/ForbesLindesay/with.git"
  },
  "author": {
    "name": "ForbesLindesay"
  },
  "license": "MIT",
  "dependencies": {
    "acorn": "^1.0.1",
    "acorn-globals": "^1.0.3"
  },
  "devDependencies": {
    "mocha": "~1.12.0",
    "uglify-js": "^2.4.15"
  },
  "readme": "# with\n\nCompile time `with` for strict mode JavaScript\n\n[![build status](https://secure.travis-ci.org/ForbesLindesay/with.png)](http://travis-ci.org/ForbesLindesay/with)\n[![Dependency Status](https://img.shields.io/gemnasium/ForbesLindesay/with.svg)](https://gemnasium.com/ForbesLindesay/with)\n[![NPM version](https://img.shields.io/npm/v/with.svg)](http://badge.fury.io/js/with)\n\n## Installation\n\n    $ npm install with\n\n## Usage\n\n```js\nvar addWith = require('with')\n\naddWith('obj', 'console.log(a)')\n// => ';(function (console, a) {\n//       console.log(a)\n//     }(\"console\" in obj ? obj.console :\n//                          typeof console!==\"undefined\" ? console : undefined,\n//       \"a\" in obj ? obj.a :\n//                    typeof a !== \"undefined\" ? a : undefined));'\n\naddWith('obj', 'console.log(a)', ['console'])\n// => ';(function (console, a) {\n//       console.log(a)\n//     }(\"a\" in obj ? obj.a :\n//                    typeof a !== \"undefined\" ? a : undefined));'\n```\n\n## API\n\n### addWith(obj, src[, exclude])\n\nThe idea is that this is roughly equivallent to:\n\n```js\nwith (obj) {\n  src\n}\n```\n\nThere are a few differences though.  For starters, assignments to variables will always remain contained within the with block.\n\ne.g.\n\n```js\nvar foo = 'foo'\nwith ({}) {\n  foo = 'bar'\n}\nassert(foo === 'bar')// => This fails for compile time with but passes for native with\n\nvar obj = {foo: 'foo'}\nwith ({}) {\n  foo = 'bar'\n}\nassert(obj.foo === 'bar')// => This fails for compile time with but passes for native with\n```\n\nIt also makes everything be declared, so you can always do:\n\n```js\nif (foo === undefined)\n```\n\ninstead of\n\n```js\nif (typeof foo === 'undefined')\n```\n\nThis is not the case if foo is in `exclude`.  If a variable is excluded, we ignore it entirely.  This is useful if you know a variable will be global as it can lead to efficiency improvements.\n\nIt is also safe to use in strict mode (unlike `with`) and it minifies properly (`with` disables virtually all minification).\n\n## License\n\n  MIT",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/ForbesLindesay/with/issues"
  },
  "homepage": "https://github.com/ForbesLindesay/with",
  "_id": "with@4.0.3",
  "dist": {
    "shasum": "b30857504dd90b55c61eccd3721ca42a5bc87e7a"
  },
  "_from": "with@~4.0.0",
  "_resolved": "https://registry.npmjs.org/with/-/with-4.0.3.tgz"
}
