{
  "name": "constantinople",
  "version": "2.0.1",
  "description": "Determine whether a JavaScript expression evaluates to a constant (using UglifyJS)",
  "keywords": [],
  "dependencies": {
    "uglify-js": "~2.4.0"
  },
  "devDependencies": {
    "mocha": "*"
  },
  "scripts": {
    "test": "mocha -R spec"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/ForbesLindesay/constantinople.git"
  },
  "author": {
    "name": "ForbesLindesay"
  },
  "license": "MIT",
  "readme": "# constantinople\r\n\r\nDetermine whether a JavaScript expression evaluates to a constant (using UglifyJS).  Here it is assumed to be safe to underestimate how constant something is.\r\n\r\n[![Build Status](https://img.shields.io/travis/ForbesLindesay/constantinople/master.svg)](https://travis-ci.org/ForbesLindesay/constantinople)\r\n[![Dependency Status](https://img.shields.io/gemnasium/ForbesLindesay/constantinople.svg)](https://gemnasium.com/ForbesLindesay/constantinople)\r\n[![NPM version](https://img.shields.io/npm/v/constantinople.svg)](http://badge.fury.io/js/constantinople)\r\n\r\n## Installation\r\n\r\n    npm install constantinople\r\n\r\n## Usage\r\n\r\n```js\r\nvar isConstant = require('constantinople')\r\n\r\nif (isConstant('\"foo\" + 5')) {\r\n  console.dir(isConstant.toConstant('\"foo\" + 5'))\r\n}\r\nif (isConstant('Math.floor(10.5)', {Math: Math})) {\r\n  console.dir(isConstant.toConstant('Math.floor(10.5)', {Math: Math}))\r\n}\r\n```\r\n\r\n## API\r\n\r\n### isConstant(src, [constants])\r\n\r\nReturns `true` if `src` evaluates to a constant, `false` otherwise.  It will also return `false` if there is a syntax error, which makes it safe to use on potentially ES6 code.\r\n\r\nConstants is an object mapping strings to values, where those values should be treated as constants.  Note that this makes it a pretty bad idea to have `Math` in there if the user might make use of `Math.random` and a pretty bad idea to have `Date` in there.\r\n\r\n### toConstant(src, [constants])\r\n\r\nReturns the value resulting from evaluating `src`.  This method throws an error if the expression is not constant.  e.g. `toConstant(\"Math.random()\")` would throw an error.\r\n\r\nConstants is an object mapping strings to values, where those values should be treated as constants.  Note that this makes it a pretty bad idea to have `Math` in there if the user might make use of `Math.random` and a pretty bad idea to have `Date` in there.\r\n\r\n## License\r\n\r\n  MIT",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/ForbesLindesay/constantinople/issues"
  },
  "_id": "constantinople@2.0.1",
  "_from": "constantinople@~2.0.0"
}
