{"_id":"is-expression","_rev":"81659","name":"is-expression","description":"Check if a string is a valid JavaScript expression","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"time":{"modified":"2021-06-03T10:26:03.000Z","created":"2015-11-12T01:39:00.612Z","4.0.0":"2020-05-19T22:45:35.608Z","3.0.0":"2016-09-12T00:03:26.635Z","2.1.0":"2016-07-26T18:43:55.226Z","2.0.1":"2016-06-04T01:14:50.531Z","2.0.0":"2016-02-13T01:21:16.927Z","1.0.2":"2016-01-07T01:37:50.414Z","1.0.1":"2015-11-12T16:57:36.341Z","1.0.0":"2015-11-12T01:39:00.612Z"},"users":{"rocket0191":true},"author":{"name":"Timothy Gu","email":"timothygu99@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/pugjs/is-expression.git"},"versions":{"4.0.0":{"name":"is-expression","version":"4.0.0","description":"Check if a string is a valid JavaScript expression","keywords":["javascript","expression"],"dependencies":{"acorn":"^7.1.1","object-assign":"^4.1.1"},"devDependencies":{"nyc":"^15.0.1","testit":"^3.1.0"},"scripts":{"test":"node test && npm run coverage","coverage":"nyc node test.js"},"repository":{"type":"git","url":"git+https://github.com/pugjs/is-expression.git"},"author":{"name":"Timothy Gu","email":"timothygu99@gmail.com"},"license":"MIT","gitHead":"0a6fd6f92cfb707ca5fd293b465bfbeda6b81f76","bugs":{"url":"https://github.com/pugjs/is-expression/issues"},"homepage":"https://github.com/pugjs/is-expression#readme","_id":"is-expression@4.0.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"shasum":"c33155962abf21d0afd2552514d67d2ec16fd2ab","size":2844,"noattachment":false,"key":"/is-expression/-/is-expression-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-expression/download/is-expression-4.0.0.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"_npmUser":{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-expression_4.0.0_1589928335156_0.7831520421332197"},"_hasShrinkwrap":false,"publish_time":1589928335608,"_cnpm_publish_time":1589928335608},"3.0.0":{"name":"is-expression","version":"3.0.0","description":"Check if a string is a valid JavaScript expression","keywords":["javascript","expression"],"dependencies":{"acorn":"~4.0.2","object-assign":"^4.0.1"},"devDependencies":{"istanbul":"*","testit":"^2.0.2"},"scripts":{"test":"node test && npm run coverage","coverage":"istanbul cover test.js"},"repository":{"type":"git","url":"git+https://github.com/pugjs/is-expression.git"},"author":{"name":"Timothy Gu","email":"timothygu99@gmail.com"},"license":"MIT","gitHead":"fc635340548d1114707497e39babe8dc476326c8","bugs":{"url":"https://github.com/pugjs/is-expression/issues"},"homepage":"https://github.com/pugjs/is-expression#readme","_id":"is-expression@3.0.0","_shasum":"39acaa6be7fd1f3471dc42c7416e61c24317ac9f","_from":".","_npmVersion":"3.10.7","_nodeVersion":"6.4.0","_npmUser":{"name":"timothygu","email":"timothygu99@gmail.com"},"dist":{"shasum":"39acaa6be7fd1f3471dc42c7416e61c24317ac9f","size":3369,"noattachment":false,"key":"/is-expression/-/is-expression-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-expression/download/is-expression-3.0.0.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/is-expression-3.0.0.tgz_1473638606404_0.5194024990778416"},"directories":{},"publish_time":1473638606635,"_cnpm_publish_time":1473638606635,"_hasShrinkwrap":false},"2.1.0":{"name":"is-expression","version":"2.1.0","description":"Check if a string is a valid JavaScript expression","keywords":["javascript","expression"],"dependencies":{"acorn":"~3.3.0","object-assign":"^4.0.1"},"devDependencies":{"istanbul":"*","testit":"^2.0.2"},"scripts":{"test":"node test && npm run coverage","coverage":"istanbul cover test.js"},"repository":{"type":"git","url":"git+https://github.com/pugjs/is-expression.git"},"author":{"name":"Timothy Gu","email":"timothygu99@gmail.com"},"license":"MIT","gitHead":"28810ef58c4993deb7700ecb4e577401b2b1444c","bugs":{"url":"https://github.com/pugjs/is-expression/issues"},"homepage":"https://github.com/pugjs/is-expression#readme","_id":"is-expression@2.1.0","_shasum":"91be9d47debcfef077977e9722be6dcfb4465ef0","_from":".","_npmVersion":"3.9.6","_nodeVersion":"6.2.1","_npmUser":{"name":"timothygu","email":"timothygu99@gmail.com"},"dist":{"shasum":"91be9d47debcfef077977e9722be6dcfb4465ef0","size":3302,"noattachment":false,"key":"/is-expression/-/is-expression-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-expression/download/is-expression-2.1.0.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/is-expression-2.1.0.tgz_1469558631250_0.5454726330935955"},"directories":{},"publish_time":1469558635226,"_cnpm_publish_time":1469558635226,"_hasShrinkwrap":false},"2.0.1":{"name":"is-expression","version":"2.0.1","description":"Check if a string is a valid JavaScript expression","keywords":["javascript","expression"],"dependencies":{"acorn":"~3.1.0","object-assign":"^4.0.1"},"devDependencies":{"istanbul":"*","testit":"^2.0.2"},"scripts":{"test":"node test && npm run coverage","coverage":"istanbul cover test.js"},"repository":{"type":"git","url":"git+https://github.com/TimothyGu/is-expression.git"},"author":{"name":"Timothy Gu","email":"timothygu99@gmail.com"},"license":"MIT","gitHead":"10369bf658d23e0925124ba9ec1232b200a835b2","bugs":{"url":"https://github.com/TimothyGu/is-expression/issues"},"homepage":"https://github.com/TimothyGu/is-expression#readme","_id":"is-expression@2.0.1","_shasum":"0c765eb662bcb2f831cb51054052a9c9e97426c5","_from":".","_npmVersion":"3.9.6","_nodeVersion":"6.2.1","_npmUser":{"name":"timothygu","email":"timothygu99@gmail.com"},"dist":{"shasum":"0c765eb662bcb2f831cb51054052a9c9e97426c5","size":3175,"noattachment":false,"key":"/is-expression/-/is-expression-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-expression/download/is-expression-2.0.1.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/is-expression-2.0.1.tgz_1465002887585_0.959619504166767"},"directories":{},"publish_time":1465002890531,"_cnpm_publish_time":1465002890531,"_hasShrinkwrap":false},"2.0.0":{"name":"is-expression","version":"2.0.0","description":"Check if a string is a valid JavaScript expression","keywords":["javascript","expression"],"dependencies":{"acorn":"~3.0.2","object-assign":"^4.0.1"},"devDependencies":{"istanbul":"*","testit":"^2.0.2"},"scripts":{"test":"node test && npm run coverage","coverage":"istanbul cover test.js"},"repository":{"type":"git","url":"git+https://github.com/TimothyGu/is-expression.git"},"author":{"name":"Timothy Gu","email":"timothygu99@gmail.com"},"license":"MIT","gitHead":"9840349db22024ad408141fc3e7d3c07e99bc135","bugs":{"url":"https://github.com/TimothyGu/is-expression/issues"},"homepage":"https://github.com/TimothyGu/is-expression#readme","_id":"is-expression@2.0.0","_shasum":"230718429ddba9c9334a90876ce35e85560f114b","_from":".","_npmVersion":"3.7.2","_nodeVersion":"5.6.0","_npmUser":{"name":"timothygu","email":"timothygu99@gmail.com"},"dist":{"shasum":"230718429ddba9c9334a90876ce35e85560f114b","size":3160,"noattachment":false,"key":"/is-expression/-/is-expression-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-expression/download/is-expression-2.0.0.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/is-expression-2.0.0.tgz_1455326473612_0.3415470668114722"},"directories":{},"publish_time":1455326476927,"_cnpm_publish_time":1455326476927,"_hasShrinkwrap":false},"1.0.2":{"name":"is-expression","version":"1.0.2","description":"Check if a string is a valid JavaScript expression","keywords":["javascript","expression"],"dependencies":{"acorn":"~2.7.0","object-assign":"^4.0.1"},"devDependencies":{"istanbul":"*","testit":"^2.0.2"},"scripts":{"test":"node test && npm run coverage","coverage":"istanbul cover test.js"},"repository":{"type":"git","url":"git+https://github.com/TimothyGu/is-expression.git"},"author":{"name":"Timothy Gu","email":"timothygu99@gmail.com"},"license":"MIT","gitHead":"fe1b161b296f5dd9f7e1147b444b0f78b9f6822f","bugs":{"url":"https://github.com/TimothyGu/is-expression/issues"},"homepage":"https://github.com/TimothyGu/is-expression#readme","_id":"is-expression@1.0.2","_shasum":"a345b96218e9df21e65510c39b4dc3602fdd3f96","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.2.0","_npmUser":{"name":"timothygu","email":"timothygu99@gmail.com"},"dist":{"shasum":"a345b96218e9df21e65510c39b4dc3602fdd3f96","size":3102,"noattachment":false,"key":"/is-expression/-/is-expression-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-expression/download/is-expression-1.0.2.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"directories":{},"publish_time":1452130670414,"_cnpm_publish_time":1452130670414,"_hasShrinkwrap":false},"1.0.1":{"name":"is-expression","version":"1.0.1","description":"Check if a string is a valid JavaScript expression","keywords":["javascript","expression"],"dependencies":{"acorn":"~2.6.2","object-assign":"^4.0.1"},"devDependencies":{"istanbul":"*","testit":"^2.0.2"},"scripts":{"test":"node test && npm run coverage","coverage":"istanbul cover test"},"repository":{"type":"git","url":"git+https://github.com/TimothyGu/is-expression.git"},"author":{"name":"Timothy Gu","email":"timothygu99@gmail.com"},"license":"MIT","gitHead":"a113188097c869b204597f4b011a8a5008213c88","bugs":{"url":"https://github.com/TimothyGu/is-expression/issues"},"homepage":"https://github.com/TimothyGu/is-expression#readme","_id":"is-expression@1.0.1","_shasum":"22cfc0013e5c7044824e6aa81b286f5b94dee757","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"timothygu","email":"timothygu99@gmail.com"},"dist":{"shasum":"22cfc0013e5c7044824e6aa81b286f5b94dee757","size":3019,"noattachment":false,"key":"/is-expression/-/is-expression-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-expression/download/is-expression-1.0.1.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"directories":{},"publish_time":1447347456341,"_cnpm_publish_time":1447347456341,"_hasShrinkwrap":false},"1.0.0":{"name":"is-expression","version":"1.0.0","description":"Check if a string is a valid JavaScript expression","keywords":["javascript","expression"],"dependencies":{"acorn":"^2.6.2","object-assign":"^4.0.1"},"scripts":{"test":"node test && npm run coverage","coverage":"istanbul cover test"},"repository":{"type":"git","url":"git+https://github.com/TimothyGu/is-expression.git"},"author":{"name":"Timothy Gu","email":"timothygu99@gmail.com"},"license":"MIT","gitHead":"0ee4468630f56d6d7bdc71647ff9d4cba5bf096a","bugs":{"url":"https://github.com/TimothyGu/is-expression/issues"},"homepage":"https://github.com/TimothyGu/is-expression#readme","_id":"is-expression@1.0.0","_shasum":"72fbfbed6acae7707c02dfefec1885f157523974","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"timothygu","email":"timothygu99@gmail.com"},"dist":{"shasum":"72fbfbed6acae7707c02dfefec1885f157523974","size":5026,"noattachment":false,"key":"/is-expression/-/is-expression-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-expression/download/is-expression-1.0.0.tgz"},"maintainers":[{"name":"forbeslindesay","email":"forbes@lindesay.co.uk"}],"directories":{},"publish_time":1447292340612,"_cnpm_publish_time":1447292340612,"_hasShrinkwrap":false}},"readme":"# is-expression\n\nValidates a string as a JavaScript expression\n\n[![Build Status](https://img.shields.io/travis/pugjs/is-expression/master.svg)](https://travis-ci.org/pugjs/is-expression)\n[![Dependency Status](https://img.shields.io/david/pugjs/is-expression.svg)](https://david-dm.org/pugjs/is-expression)\n[![Rolling Versions](https://img.shields.io/badge/Rolling%20Versions-Enabled-brightgreen)](https://rollingversions.com/pugjs/is-expression)\n[![npm version](https://img.shields.io/npm/v/is-expression.svg)](https://www.npmjs.org/package/is-expression)\n\n## Installation\n\n    npm install is-expression\n\n## Usage\n\n### `isExpression(src[, options])`\n\nValidates a string as a JavaScript expression.\n\n`src` contains the source.\n\n`options` can contain any Acorn options (since we use Acorn under-the-hood),\nor any of the following:\n\n- `throw`: Throw an error if the string is not an expression. The error can\n  be an Acorn error, with location information in `err.loc` and `err.pos`.\n  Defaults to `false`.\n- `strict`: Use strict mode when trying to parse the string. Defaults to\n  `false`. Even if this option is `false`, if you have provided\n  `options.sourceType === 'module'` which imples strict mode under ES2015,\n  strict mode will be used.\n- `lineComment`: When `true`, allows line comments in the expression.\n  Defaults to `false` for safety.\n\nSee the examples below for usage.\n\n## Examples\n\n```js\nvar isExpression = require('is-expression')\n\nisExpression('myVar')\n//=> true\nisExpression('var')\n//=> false\nisExpression('[\"an\", \"array\", \"\\'s\"].indexOf(\"index\")')\n//=> true\n\nisExpression('var', {throw: true})\n// SyntaxError: Unexpected token (1:0)\n//     at Parser.pp.raise (acorn/dist/acorn.js:940:13)\n//     at ...\n\nisExpression('public')\n//=> true\nisExpression('public', {strict: true})\n//=> false\n\nisExpression('abc // my comment')\n//=> false\nisExpression('abc // my comment', {lineComment: true})\n//=> true\n```\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/pugjs/is-expression#readme","bugs":{"url":"https://github.com/pugjs/is-expression/issues"},"license":"MIT"}