{"name":"babel-errors","version":"1.1.0","description":"Nicer error messages for Babel","main":"index.js","author":{"name":"James Kyle","email":"me@thejameskyle.com"},"license":"MIT","devDependencies":{"flow-bin":"^0.46.0"},"gitHead":"4764605d8446a4a2c15a78f2c6f7c7b51212c2ed","_id":"babel-errors@1.1.0","scripts":{},"_shasum":"8cdd3754d750a480b8a26e0bc17f5e490926b36c","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"thejameskyle","email":"me@thejameskyle.com"},"dist":{"shasum":"8cdd3754d750a480b8a26e0bc17f5e490926b36c","tarball":"http://registry-npm.ywwl.com/babel-errors/download/babel-errors-1.1.0.tgz","integrity":"sha512-gs/oIGs9SlD6rO7Ky6Y6I+S76nHqUb/F50srYt0r1PSnl7TfAIxlKgXXWPoI6SMHMEKQMTZwvXxoh/FCM65mUw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDc+LBmARdINC4wtPYlmDHmRS751h7mNcVNoi6A844CTAIgAPPvIX3npNaMU4NymuzeWwKztO3qTTXKlVwh0RYtb1A="}],"size":2906,"noattachment":false,"key":"/babel-errors/-/babel-errors-1.1.0.tgz"},"maintainers":[{"name":"thejameskyle","email":"me@thejameskyle.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-errors-1.1.0.tgz_1495855897753_0.45476756733842194"},"directories":{},"readme":"# babel-errors\n\n> Nicer error messages for Babel\n\n```js\nimport createBabelFile from 'babel-file';\nimport {BabelError, prettyError, buildCodeFrameError} from 'babel-errors';\n\nconst file = createBabelFile(...);\n\nlet path = file.path;\nlet {line, column} = path.loc.start;\n\nthrow prettyError(createErrorWithLoc('Error at this position', line, column));\nthrow buildCodeFrameError(path, 'Error with this Path');\n```\n\n### `createErrorWithLoc(message, line, column)`\n\nThis lets you add location information to your errors.\n\n### `wrapErrorWithCodeFrame(err)`\n\nYou can use this when capturing errors thrown by Babel or constructed using\n`createErrorWithLoc` to add a code frame when possible.\n\n### `buildCodeFrameError(path, message)`\n\nYou can use this to build a code frame error around a path with a specified\nmessage.\n\nUse this instead of `path.buildCodeFrameError` when you aren't running inside a\nBabel plugin.\n\n### `toErrorStack(error)`\n\nCreates string with error name, message, stack/code frame.\n","publish_time":1495855897952,"_cnpm_publish_time":1495855897952,"dist-tags":{"latest":"1.1.1"}}