{ "_args": [ [ { "raw": "@babel/code-frame@^7.0.0-beta.35", "scope": "@babel", "escapedName": "@babel%2fcode-frame", "name": "@babel/code-frame", "rawSpec": "^7.0.0-beta.35", "spec": ">=7.0.0-beta.35 <8.0.0", "type": "range" }, "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/jest-message-util" ] ], "_from": "@babel/code-frame@^7.0.0-beta.35", "_hasShrinkwrap": false, "_id": "@babel/code-frame@7.0.0-beta.40", "_location": "/@babel/code-frame", "_nodeVersion": "8.9.1", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/code-frame_7.0.0-beta.40_1518453713791_0.6272798336555065" }, "_npmUser": { "name": "hzoo", "email": "hi@henryzoo.com" }, "_npmVersion": "5.6.0", "_phantomChildren": {}, "_requested": { "raw": "@babel/code-frame@^7.0.0-beta.35", "scope": "@babel", "escapedName": "@babel%2fcode-frame", "name": "@babel/code-frame", "rawSpec": "^7.0.0-beta.35", "spec": ">=7.0.0-beta.35 <8.0.0", "type": "range" }, "_requiredBy": [ "/jest-message-util" ], "_resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz", "_shasum": "37e2b0cf7c56026b4b21d3927cadf81adec32ac6", "_shrinkwrap": null, "_spec": "@babel/code-frame@^7.0.0-beta.35", "_where": "/Volumes/2009-SSD/GT2/GT2-iOS/node_modules/jest-message-util", "author": { "name": "Sebastian McKenzie", "email": "sebmck@gmail.com" }, "dependencies": { "@babel/highlight": "7.0.0-beta.40" }, "description": "Generate errors that contain a code frame that point to source locations.", "devDependencies": { "chalk": "^2.0.0", "strip-ansi": "^4.0.0" }, "directories": {}, "dist": { "integrity": "sha512-eVXQSbu/RimU6OKcK2/gDJVTFcxXJI4sHbIqw2mhwMZeQ2as/8AhS9DGkEDoHMBBNJZ5B0US63lF56x+KDcxiA==", "shasum": "37e2b0cf7c56026b4b21d3927cadf81adec32ac6", "tarball": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz", "fileCount": 3, "unpackedSize": 8737 }, "homepage": "https://babeljs.io/", "license": "MIT", "main": "lib/index.js", "maintainers": [ { "name": "andarist", "email": "mateuszburzynski@gmail.com" }, { "name": "danez", "email": "daniel@tschinder.de" }, { "name": "existentialism", "email": "bng412@gmail.com" }, { "name": "hzoo", "email": "hi@henryzoo.com" }, { "name": "loganfsmyth", "email": "loganfsmyth@gmail.com" }, { "name": "xtuc", "email": "contact@xtuc.fr" } ], "name": "@babel/code-frame", "optionalDependencies": {}, "readme": "# @babel/code-frame\n\n> Generate errors that contain a code frame that point to source locations.\n\n## Install\n\n```sh\nnpm install --save-dev @babel/code-frame\n```\n\n## Usage\n\n```js\nimport { codeFrameColumns } from '@babel/code-frame';\n\nconst rawLines = `class Foo {\n constructor()\n}`;\nconst location = { start: { line: 2, column: 16 } };\n\nconst result = codeFrameColumns(rawLines, location, { /* options */ });\n\nconsole.log(result);\n```\n\n```\n 1 | class Foo {\n> 2 | constructor()\n | ^\n 3 | }\n```\n\nIf the column number is not known, you may omit it.\n\nYou can also pass an `end` hash in `location`.\n\n```js\nimport { codeFrameColumns } from '@babel/code-frame';\n\nconst rawLines = `class Foo {\n constructor() {\n console.log(\"hello\");\n }\n}`;\nconst location = { start: { line: 2, column: 17 }, end: { line: 4, column: 3 } };\n\nconst result = codeFrameColumns(rawLines, location, { /* options */ });\n\nconsole.log(result);\n```\n\n```\n 1 | class Foo {\n> 2 | constructor() {\n | ^\n> 3 | console.log(\"hello\");\n | ^^^^^^^^^^^^^^^^^^^^^^^^^\n> 4 | }\n | ^^^\n 5 | };\n```\n\n## Options\n\n### `highlightCode`\n\n`boolean`, defaults to `false`.\n\nToggles syntax highlighting the code as JavaScript for terminals.\n\n\n### `linesAbove`\n\n`number`, defaults to `2`.\n\nAdjust the number of lines to show above the error.\n\n### `linesBelow`\n\n`number`, defaults to `3`.\n\nAdjust the number of lines to show below the error.\n\n### `forceColor`\n\n`boolean`, defaults to `false`.\n\nEnable this to forcibly syntax highlight the code as JavaScript (for non-terminals); overrides `highlightCode`.\n\n### `message`\n\n`string`, otherwise nothing\n\nPass in a string to be displayed inline (if possible) next to the highlighted\nlocation in the code. If it can't be positioned inline, it will be placed above\nthe code frame.\n\n```\n1 | class Foo {\n> 2 | constructor()\n | ^ Missing {\n3 | };\n```\n\n## Upgrading from prior versions\n\nPrior to version 7, the only API exposed by this module was for a single line and optional column pointer. The old API will now log a deprecation warning.\n\nThe new API takes a `location` object, similar to what is available in an AST.\n\nThis is an example of the deprecated (but still available) API:\n\n```js\nimport codeFrame from '@babel/code-frame';\n\nconst rawLines = `class Foo {\n constructor()\n}`;\nconst lineNumber = 2;\nconst colNumber = 16;\n\nconst result = codeFrame(rawLines, lineNumber, colNumber, { /* options */ });\n\nconsole.log(result);\n```\n\nTo get the same highlighting using the new API:\n\n```js\nimport { codeFrameColumns } from '@babel/code-frame';\n\nconst rawLines = `class Foo {\n constructor() {\n console.log(\"hello\");\n }\n}`;\nconst location = { start: { line: 2, column: 16 } };\n\nconst result = codeFrameColumns(rawLines, location, { /* options */ });\n\nconsole.log(result);\n```\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "https://github.com/babel/babel/tree/master/packages/babel-code-frame" }, "version": "7.0.0-beta.40" }