{"_id":"code-frame","_rev":"2169335","name":"code-frame","description":"Minimal Code Frame like babel-code-frame, but smaller","dist-tags":{"latest":"5.0.0"},"maintainers":[{"name":"hhsnopek","email":"hhsnopek@gmail.com"}],"time":{"modified":"2022-01-05T02:57:47.000Z","created":"2016-08-19T04:44:57.674Z","5.0.0":"2016-11-21T20:24:47.284Z","4.0.0":"2016-09-04T02:53:09.122Z","3.0.0":"2016-09-03T06:18:44.861Z","2.0.0":"2016-08-19T14:22:04.722Z","1.0.1":"2016-08-19T05:08:18.449Z","1.0.0":"2016-08-19T04:44:57.674Z"},"users":{},"author":{"name":"Henry Snopek","email":"hhsnopek@gmail.com","url":"http://hhsnopek.com/"},"repository":{"type":"git","url":"git+ssh://git@github.com/hhsnopek/code-frame.git"},"versions":{"5.0.0":{"name":"code-frame","version":"5.0.0","description":"Minimal Code Frame like babel-code-frame, but smaller","main":"lib/index.js","scripts":{"test":"npm run lint && nyc ava","lint":"standard | snazzy","coverage":"npm test && nyc report --reporter=html && open ./coverage/index.html","coveralls":"nyc report --reporter=text-lcov | coveralls"},"ava":{"verbose":"true"},"engines":{"node":">= 4.0.0"},"repository":{"type":"git","url":"git+ssh://git@github.com/hhsnopek/code-frame.git"},"author":{"name":"Henry Snopek","email":"hhsnopek@gmail.com","url":"http://hhsnopek.com/"},"license":"MIT","bugs":{"url":"https://github.com/hhsnopek/code-frame/issues"},"homepage":"https://github.com/hhsnopek/code-frame#readme","devDependencies":{"ava":"^0.17.0","coveralls":"^2.11.15","nyc":"^9.0.1","snazzy":"^5.0.0","standard":"^8.5.0"},"dependencies":{"left-pad":"^1.1.3"},"gitHead":"e4c233e958d17a0798a43ebe028e701348cfc7a1","_id":"code-frame@5.0.0","_shasum":"40030707ec46e1d99d5e52dc9f357fcad90d993d","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.1.0","_npmUser":{"name":"hhsnopek","email":"hhsnopek@gmail.com"},"dist":{"shasum":"40030707ec46e1d99d5e52dc9f357fcad90d993d","size":3199,"noattachment":false,"key":"/code-frame/-/code-frame-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/code-frame/download/code-frame-5.0.0.tgz"},"maintainers":[{"name":"hhsnopek","email":"hhsnopek@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/code-frame-5.0.0.tgz_1479759885260_0.7260042657144368"},"directories":{},"publish_time":1479759887284,"_cnpm_publish_time":1479759887284,"_hasShrinkwrap":false},"4.0.0":{"name":"code-frame","version":"4.0.0","description":"Minimal Code Frame like babel-code-frame, but smaller","main":"lib/index.js","scripts":{"test":"npm run lint && nyc ava","lint":"standard | snazzy","coverage":"npm test && nyc report --reporter=html && open ./coverage/index.html","coveralls":"nyc report --reporter=text-lcov | coveralls"},"ava":{"verbose":"true"},"engines":{"node":">= 4.0.0"},"repository":{"type":"git","url":"git+ssh://git@github.com/hhsnopek/code-frame.git"},"author":{"name":"Henry Snopek","email":"hhsnopek@gmail.com","url":"http://hhsnopek.com/"},"license":"MIT","bugs":{"url":"https://github.com/hhsnopek/code-frame/issues"},"homepage":"https://github.com/hhsnopek/code-frame#readme","devDependencies":{"ava":"^0.16.0","coveralls":"^2.11.12","nyc":"^8.1.0","snazzy":"^4.0.1","standard":"^8.0.0"},"dependencies":{"left-pad":"^1.1.1"},"gitHead":"16893174ba023cf7a629bc06e36ff18d662a2a15","_id":"code-frame@4.0.0","_shasum":"fb02a19d9e6c8404addee87b1672142919d2ec64","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"hhsnopek","email":"hhsnopek@gmail.com"},"dist":{"shasum":"fb02a19d9e6c8404addee87b1672142919d2ec64","size":2151,"noattachment":false,"key":"/code-frame/-/code-frame-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/code-frame/download/code-frame-4.0.0.tgz"},"maintainers":[{"name":"hhsnopek","email":"hhsnopek@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/code-frame-4.0.0.tgz_1472957587165_0.8437962478492409"},"directories":{},"publish_time":1472957589122,"_cnpm_publish_time":1472957589122,"_hasShrinkwrap":false},"3.0.0":{"name":"code-frame","version":"3.0.0","description":"Minimal Code Frame like babel-code-frame, but smaller","main":"lib/index.js","scripts":{"test":"npm run lint && nyc ava","lint":"standard | snazzy","coverage":"npm test && nyc report --reporter=html && open ./coverage/index.html","coveralls":"nyc report --reporter=text-lcov | coveralls"},"ava":{"verbose":"true"},"engines":{"node":">= 4.0.0"},"repository":{"type":"git","url":"git+ssh://git@github.com/hhsnopek/code-frame.git"},"author":{"name":"Henry Snopek","email":"hhsnopek@gmail.com","url":"http://hhsnopek.com/"},"license":"MIT","bugs":{"url":"https://github.com/hhsnopek/code-frame/issues"},"homepage":"https://github.com/hhsnopek/code-frame#readme","devDependencies":{"ava":"^0.16.0","coveralls":"^2.11.12","nyc":"^8.1.0","snazzy":"^4.0.1","standard":"^8.0.0"},"dependencies":{"left-pad":"^1.1.1"},"gitHead":"b8bdbd85feefabe502256e0421fceb98a84d3ab7","_id":"code-frame@3.0.0","_shasum":"0026c8013f3fe5aa8ed856e526bbc66a2a1b68e1","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"hhsnopek","email":"hhsnopek@gmail.com"},"dist":{"shasum":"0026c8013f3fe5aa8ed856e526bbc66a2a1b68e1","size":2157,"noattachment":false,"key":"/code-frame/-/code-frame-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/code-frame/download/code-frame-3.0.0.tgz"},"maintainers":[{"name":"hhsnopek","email":"hhsnopek@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/code-frame-3.0.0.tgz_1472883523328_0.6757273126859218"},"directories":{},"publish_time":1472883524861,"_cnpm_publish_time":1472883524861,"_hasShrinkwrap":false},"2.0.0":{"name":"code-frame","version":"2.0.0","description":"Minimal Code Frame like babel-code-frame, but smaller","main":"lib/index.js","scripts":{"test":"npm run lint && nyc ava","lint":"standard | snazzy","coverage":"npm test && nyc report --reporter=html && open ./coverage/index.html","coveralls":"nyc report --reporter=text-lcov | coveralls"},"ava":{"verbose":"true"},"engines":{"node":">= 4.0.0"},"repository":{"type":"git","url":"git+ssh://git@github.com/hhsnopek/code-frame.git"},"author":{"name":"Henry Snopek","email":"hhsnopek@gmail.com","url":"http://hhsnopek.com/"},"license":"MIT","bugs":{"url":"https://github.com/hhsnopek/code-frame/issues"},"homepage":"https://github.com/hhsnopek/code-frame#readme","devDependencies":{"ava":"^0.16.0","coveralls":"^2.11.12","nyc":"^8.1.0","snazzy":"^4.0.1","standard":"^7.1.2"},"dependencies":{"left-pad":"^1.1.1"},"gitHead":"519c071311e53c4d061adff95e2f804141812d98","_id":"code-frame@2.0.0","_shasum":"4bb4fcb2c997a84837fe92fd571e5df69085ac5b","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"hhsnopek","email":"hhsnopek@gmail.com"},"dist":{"shasum":"4bb4fcb2c997a84837fe92fd571e5df69085ac5b","size":2066,"noattachment":false,"key":"/code-frame/-/code-frame-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/code-frame/download/code-frame-2.0.0.tgz"},"maintainers":[{"name":"hhsnopek","email":"hhsnopek@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/code-frame-2.0.0.tgz_1471616523533_0.7601028210483491"},"directories":{},"publish_time":1471616524722,"_cnpm_publish_time":1471616524722,"_hasShrinkwrap":false},"1.0.1":{"name":"code-frame","version":"1.0.1","description":"Minimal Code Frame like babel-code-frame, but smaller","main":"lib/index.js","scripts":{"test":"npm run lint && nyc ava","lint":"standard | snazzy","coverage":"npm test && nyc report --reporter=html && open ./coverage/index.html","coveralls":"nyc report --reporter=text-lcov | coveralls"},"ava":{"verbose":"true"},"engines":{"node":">= 6.0.0"},"repository":{"type":"git","url":"git+ssh://git@github.com/hhsnopek/code-frame.git"},"author":{"name":"Henry Snopek","email":"hhsnopek@gmail.com","url":"http://hhsnopek.com/"},"license":"MIT","bugs":{"url":"https://github.com/hhsnopek/code-frame/issues"},"homepage":"https://github.com/hhsnopek/code-frame#readme","devDependencies":{"ava":"^0.16.0","coveralls":"^2.11.12","nyc":"^8.1.0","snazzy":"^4.0.1","standard":"^7.1.2"},"dependencies":{"left-pad":"^1.1.1"},"gitHead":"35a14e0967510a83b2b8d032f102e1eb9b170694","_id":"code-frame@1.0.1","_shasum":"32b7bfea78ba35c02ebdaacc02fd20ed16489bc2","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"hhsnopek","email":"hhsnopek@gmail.com"},"dist":{"shasum":"32b7bfea78ba35c02ebdaacc02fd20ed16489bc2","size":2053,"noattachment":false,"key":"/code-frame/-/code-frame-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/code-frame/download/code-frame-1.0.1.tgz"},"maintainers":[{"name":"hhsnopek","email":"hhsnopek@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/code-frame-1.0.1.tgz_1471583296893_0.790149784879759"},"directories":{},"publish_time":1471583298449,"_cnpm_publish_time":1471583298449,"_hasShrinkwrap":false},"1.0.0":{"name":"code-frame","version":"1.0.0","description":"Got an error, give me the src/line/col and I'll frame it for you.","main":"lib/index.js","scripts":{"test":"npm run lint && nyc ava","lint":"standard | snazzy","coverage":"npm test && nyc report --reporter=html && open ./coverage/index.html","coveralls":"nyc report --reporter=text-lcov | coveralls"},"ava":{"verbose":"true"},"engines":{"node":">= 6.0.0"},"repository":{"type":"git","url":"git+ssh://git@github.com/hhsnopek/code-frame.git"},"author":{"name":"Henry Snopek","email":"hhsnopek@gmail.com","url":"http://hhsnopek.com/"},"license":"MIT","bugs":{"url":"https://github.com/hhsnopek/code-frame/issues"},"homepage":"https://github.com/hhsnopek/code-frame#readme","devDependencies":{"ava":"^0.16.0","coveralls":"^2.11.12","nyc":"^8.1.0","snazzy":"^4.0.1","standard":"^7.1.2"},"dependencies":{"left-pad":"^1.1.1"},"gitHead":"77a737873160da458cbe70305749eb2c0d0e73f4","_id":"code-frame@1.0.0","_shasum":"f33d6563f9b586df375205ae494bd01ca939edb2","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"hhsnopek","email":"hhsnopek@gmail.com"},"dist":{"shasum":"f33d6563f9b586df375205ae494bd01ca939edb2","size":2073,"noattachment":false,"key":"/code-frame/-/code-frame-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/code-frame/download/code-frame-1.0.0.tgz"},"maintainers":[{"name":"hhsnopek","email":"hhsnopek@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/code-frame-1.0.0.tgz_1471581896647_0.3734210419934243"},"directories":{},"publish_time":1471581897674,"_cnpm_publish_time":1471581897674,"_hasShrinkwrap":false}},"readme":"# Code Frame [![npm](https://img.shields.io/npm/v/code-frame.svg?style=flat-square)](https://npmjs.com/package/code-frame) [![tests](https://img.shields.io/travis/hhsnopek/code-frame.svg?style=flat-square)](https://travis-ci.org/hhsnopek/code-frame?branch=master) [![coverage](https://img.shields.io/coveralls/hhsnopek/code-frame.svg?style=flat-square)](https://coveralls.io/r/hhsnopek/code-frame?branch=master)\n> Minimal Code Frame like babel-code-frame, but smaller\n\n## Install\n```bash\nnpm install --save code-frame\n```\n\n## Usage\n```javascript\nconst framer = require('code-frame')\n\n// framer('...', OffendingLine, OffendingColumn, {\n//   frameSize: 3,\n//   tabSize: 2\n// })\n\n// Opts:\n//   'frameSize': (default: 3)\n//       This is calcuation is Line - Surrounding.\n//       If you provide, 3, it will capture a total of two surrounding lines.\n//           2 | function (foo) {\n//         > 3 |   console.log(foo\n//             |                  ^\n//\n//       The frame is formed from bottom to top. ex: 4 = ((3 - 1) / 2) gives us 1\n//       line on top and bottom. If you provide an even number, 4, you'd result in\n//       2 lines above and one below.\n//           2 | var bar = function (foo) {\n//         > 3 |   console.log(foo\n//             |                  ^\n//           4 |   foo = foo ? foo : 'baz'\n//\n//       Inorder to get the opposite result you'd inverse the frameSize, -4\n//           1 | // function bar\n//           2 | var bar = function (foo) {\n//         > 3 |   console.log(foo\n//             |                  ^\n//\n//       Caveats:\n//         frame cuts off if the wrapping lines hit EOF/Start of File. If the\n//         frameSize is 3 and the error is on line 1:\n//           > 1 | 'use strict;\n//               |            ^\n//\n//   'tabSize': (default: 2)\n//     If mixed tabs are found on anylines while constructing the frame, we\n//     convert them over to spaces. You may define a positive integer.\n```\n\n## License\nMIT © [Henry Snopek](https://hhsnopek.com)\n","_attachments":{},"homepage":"https://github.com/hhsnopek/code-frame#readme","bugs":{"url":"https://github.com/hhsnopek/code-frame/issues"},"license":"MIT"}