-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
44 lines (44 loc) · 2.98 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
"name": "syntax-error",
"version": "1.1.2",
"description": "detect and report syntax errors in source code strings",
"main": "index.js",
"dependencies": {
"acorn": "~0.9.0"
},
"devDependencies": {
"tape": "~2.4.1"
},
"scripts": {
"test": "tape test/*.js"
},
"repository": {
"type": "git",
"url": "git://github.com/substack/node-syntax-error.git"
},
"homepage": "https://github.com/substack/node-syntax-error",
"keywords": [
"syntax",
"error",
"esprima",
"stack",
"line",
"column"
],
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"license": "MIT",
"engine": {
"node": ">=0.6"
},
"readme": "# syntax-error\n\nDetect and report syntax errors in source code strings.\n\n[![build status](https://secure.travis-ci.org/substack/node-syntax-error.png)](http://travis-ci.org/substack/node-syntax-error)\n\nWhen you type `node src.js` you get a friendly error report about exactly where\nthe syntax error is. This module lets you check for syntax errors and report\nthem in a similarly friendly format that wrapping a try/catch around\n`Function()` or `vm.runInNewContext()` doesn't get you.\n\n# example\n\n``` js\nvar fs = require('fs');\nvar check = require('syntax-error');\n\nvar file = __dirname + '/src.js';\nvar src = fs.readFileSync(file);\n\nvar err = check(src, file);\nif (err) {\n console.error('ERROR DETECTED' + Array(62).join('!'));\n console.error(err);\n console.error(Array(76).join('-'));\n}\n```\n\n***\n\n```\n$ node check.js\nERROR DETECTED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n/home/substack/projects/node-syntax-error/example/src.js:5\n if (Array.isArray(x) res.push.apply(res, x);\n ^\nParseError: Unexpected identifier\n---------------------------------------------------------------------------\n```\n\n# methods\n\n``` js\nvar check = require('syntax-error')\n```\n\n## var err = check(src, file)\n\nCheck the source code string `src` for syntax errors.\nOptionally you can specify a filename `file` that will show up in the output.\n\nIf `src` has a syntax error, return an error object `err` that can be printed or\nstringified.\n\nIf there are no syntax errors in `src`, return `undefined`.\n\n## err.toString()\n\nReturn the long string description with a source snippet and a `^` under\npointing exactly where the error was detected.\n\n# attributes\n\n## err.message\n\nshort string description of the error type\n\n## err.line\n\nline number of the error in the original source (indexing starts at 1)\n\n## err.column\n\ncolumn number of the error in the original source (indexing starts at 1)\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install syntax-error\n```\n\n# license\n\nMIT\n",
"readmeFilename": "readme.markdown",
"bugs": {
"url": "https://github.com/substack/node-syntax-error/issues"
},
"_id": "syntax-error@1.1.2",
"_from": "syntax-error@^1.1.1"
}