{"id":18458759,"url":"https://github.com/browserify/syntax-error","last_synced_at":"2026-01-15T22:21:11.142Z","repository":{"id":4155498,"uuid":"5269534","full_name":"browserify/syntax-error","owner":"browserify","description":"detect and report syntax errors in source code strings","archived":false,"fork":false,"pushed_at":"2024-12-21T09:59:18.000Z","size":26,"stargazers_count":80,"open_issues_count":3,"forks_count":26,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T07:50:29.377Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/browserify.png","metadata":{"files":{"readme":"readme.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-08-02T07:20:59.000Z","updated_at":"2025-02-02T14:52:52.000Z","dependencies_parsed_at":"2025-01-17T13:08:24.165Z","dependency_job_id":"8937ab44-50dc-4979-a9c4-0d3cf4f44f81","html_url":"https://github.com/browserify/syntax-error","commit_stats":{"total_commits":49,"total_committers":8,"mean_commits":6.125,"dds":0.3877551020408163,"last_synced_commit":"53e03850467a867e0f041a43673f8f0d65db8f82"},"previous_names":["substack/node-syntax-error"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fsyntax-error","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fsyntax-error/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fsyntax-error/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fsyntax-error/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserify","download_url":"https://codeload.github.com/browserify/syntax-error/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423515,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T08:19:54.718Z","updated_at":"2026-01-15T22:21:11.103Z","avatar_url":"https://github.com/browserify.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# syntax-error\n\nDetect and report syntax errors in source code strings.\n\n[![build status](https://secure.travis-ci.org/browserify/syntax-error.png)](http://travis-ci.org/browserify/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, opts={})\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\nOptions will be passed through to [acorn-node](https://github.com/browserify/acorn-node).\nacorn-node defaults to options that match the most recent Node versions.\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Fsyntax-error","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserify%2Fsyntax-error","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Fsyntax-error/lists"}