{"_id":"line-numbers","_rev":"56638","name":"line-numbers","description":"Add line numbers to a string.","dist-tags":{"latest":"0.2.2"},"maintainers":[{"name":"lydell","email":""}],"time":{"modified":"2021-06-03T10:17:15.000Z","created":"2014-12-20T22:35:34.775Z","0.2.2":"2016-03-23T18:41:52.839Z","0.2.1":"2016-03-23T18:33:02.851Z","0.2.0":"2015-02-21T17:50:40.075Z","0.1.0":"2014-12-20T22:35:34.775Z"},"users":{"saitodisse":true,"almaclaine":true},"author":{"name":"Simon Lydell"},"repository":{"type":"git","url":"git+https://github.com/lydell/line-numbers.git"},"versions":{"0.2.2":{"name":"line-numbers","version":"0.2.2","author":{"name":"Simon Lydell"},"license":"MIT","description":"Add line numbers to a string.","keywords":["line","number","numbers","file","add","insert","gutter","column","each"],"repository":{"type":"git","url":"git+https://github.com/lydell/line-numbers.git"},"scripts":{"test":"mocha --ui tdd"},"devDependencies":{"mocha":"^2.0.1"},"dependencies":{"left-pad":"^1.0.1"},"gitHead":"2938da4a39ba5274063d4ee6acbb869f5b58dd85","bugs":{"url":"https://github.com/lydell/line-numbers/issues"},"homepage":"https://github.com/lydell/line-numbers#readme","_id":"line-numbers@0.2.2","_shasum":"e6aa334440a08601be30386cfdd0341d4f8eb61d","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.0","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"dist":{"shasum":"e6aa334440a08601be30386cfdd0341d4f8eb61d","size":3346,"noattachment":false,"key":"/line-numbers/-/line-numbers-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/line-numbers/download/line-numbers-0.2.2.tgz"},"maintainers":[{"name":"lydell","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/line-numbers-0.2.2.tgz_1458758510294_0.8761831393931061"},"deprecated":"Copy its ~20 LOC directly into your code instead.","directories":{},"publish_time":1458758512839,"_cnpm_publish_time":1458758512839,"_hasShrinkwrap":false},"0.2.1":{"name":"line-numbers","version":"0.2.1","author":{"name":"Simon Lydell"},"license":"MIT","description":"Add line numbers to a string.","keywords":["line","number","numbers","file","add","insert","gutter","column","each"],"repository":{"type":"git","url":"git+https://github.com/lydell/line-numbers.git"},"scripts":{"test":"mocha --ui tdd"},"devDependencies":{"mocha":"^2.0.1"},"dependencies":{"left-pad":"^1.0.1"},"gitHead":"b3205b3d0f3abc51db83e9f4cbd1111de4c4a3e2","bugs":{"url":"https://github.com/lydell/line-numbers/issues"},"homepage":"https://github.com/lydell/line-numbers#readme","_id":"line-numbers@0.2.1","_shasum":"2267e7fc09dd686c8d0641e4f8ff81a5ff141d66","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.0","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"dist":{"shasum":"2267e7fc09dd686c8d0641e4f8ff81a5ff141d66","size":3205,"noattachment":false,"key":"/line-numbers/-/line-numbers-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/line-numbers/download/line-numbers-0.2.1.tgz"},"maintainers":[{"name":"lydell","email":""}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/line-numbers-0.2.1.tgz_1458757980519_0.4218653291463852"},"deprecated":"Copy its ~20 LOC directly into your code instead.","directories":{},"publish_time":1458757982851,"_cnpm_publish_time":1458757982851,"_hasShrinkwrap":false},"0.2.0":{"name":"line-numbers","version":"0.2.0","author":{"name":"Simon Lydell"},"license":"MIT","description":"Add line numbers to a string.","keywords":["line","number","numbers","file","add","insert","gutter","column","each"],"repository":{"type":"git","url":"https://github.com/lydell/line-numbers"},"scripts":{"test":"mocha --ui tdd"},"devDependencies":{"mocha":"^2.0.1"},"dependencies":{"left-pad":"0.0.3"},"gitHead":"eb82c0c3da335fbd80111b771a6a3e38d7f63900","bugs":{"url":"https://github.com/lydell/line-numbers/issues"},"homepage":"https://github.com/lydell/line-numbers","_id":"line-numbers@0.2.0","_shasum":"6bc028149440e570d495ab509692aa08bd779c6e","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"maintainers":[{"name":"lydell","email":""}],"dist":{"shasum":"6bc028149440e570d495ab509692aa08bd779c6e","size":3206,"noattachment":false,"key":"/line-numbers/-/line-numbers-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/line-numbers/download/line-numbers-0.2.0.tgz"},"directories":{},"publish_time":1424541040075,"_cnpm_publish_time":1424541040075,"deprecated":"Copy its ~20 LOC directly into your code instead.","_hasShrinkwrap":false},"0.1.0":{"name":"line-numbers","version":"0.1.0","author":{"name":"Simon Lydell"},"license":"MIT","description":"Add line numbers to a string.","keywords":["line","number","numbers","file","add","insert","gutter","column","each"],"repository":{"type":"git","url":"https://github.com/lydell/line-numbers"},"scripts":{"test":"mocha --ui tdd"},"devDependencies":{"mocha":"^2.0.1"},"dependencies":{"left-pad":"0.0.3"},"gitHead":"bb120569e8e5b25f115f8d94817dc9e3576ee73c","bugs":{"url":"https://github.com/lydell/line-numbers/issues"},"homepage":"https://github.com/lydell/line-numbers","_id":"line-numbers@0.1.0","_shasum":"1c2aa556a9325a1b9ea8e4efb667849af89b3ec2","_from":".","_npmVersion":"2.1.7","_nodeVersion":"0.10.33","_npmUser":{"name":"lydell","email":"simon.lydell@gmail.com"},"maintainers":[{"name":"lydell","email":""}],"dist":{"shasum":"1c2aa556a9325a1b9ea8e4efb667849af89b3ec2","size":2733,"noattachment":false,"key":"/line-numbers/-/line-numbers-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/line-numbers/download/line-numbers-0.1.0.tgz"},"directories":{},"publish_time":1419114934775,"_cnpm_publish_time":1419114934775,"deprecated":"Copy its ~20 LOC directly into your code instead.","_hasShrinkwrap":false}},"readme":"Overview [![Build Status](https://travis-ci.org/lydell/line-numbers.svg?branch=master)](https://travis-ci.org/lydell/line-numbers)\n========\n\n**DEPRECATED.** This is a rather silly package that I do not recommend using.\nIt's easier to copy the ~20 lines of code of this package and customize that\ncode, rather than downloading and learning how to use this package.\n\nAdd line numbers to a string.\n\n```js\nvar lineNumbers = require(\"line-numbers\")\n\nvar string = [\n  \"function sum(a, b) {\",\n  \"  return a + b;\",\n  \"}\"\n].join(\"\\n\")\n\nlineNumbers(string)\n// 1 | function sum(a, b) {\n// 2 |   return a + b;\n// 3 | }\n```\n\n\nInstallation\n============\n\n- `npm install line-numbers`\n\n```js\nvar lineNumbers = require(\"line-numbers\")\n```\n\n\nUsage\n=====\n\n### `lineNumbers(code, [options])` ###\n\nInserts a line number at the beginning of each line in `code`, which is either a\nstring or an array of strings—one for each line. All the line numbers are of the\nsame width; shorter numbers are padded on the left side.\n\nThe return value is of the same type as `code`.\n\n`options`:\n\n- start: `Number`. The number to use for the first line. Defaults to `1`.\n- padding: `String`. The character to pad numbers with. Defaults to `\" \"`.\n- before: `String`. String to put before the line number. Defaults to `\" \"`.\n- after: `String`. String to put between the line number and the line itself.\n  Defaults to `\" | \"`.\n- transform: `Function`. It is called for each line and passed an object with\n  the following properties:\n\n  - before: `options.before`\n  - number: `Number`. The current line number.\n  - width: `Number`. The padded width of the line numbers.\n  - after: `options.after`\n  - line: `String`. The current line.\n\n  You may modify the above properties to alter the line numbering for the\n  current line. This is useful if `before` and `after` aren’t enough, if you\n  want to colorize the line numbers, or highlight the current line.\n\n\nLicense\n=======\n\n[The X11 (“MIT”) License](LICENSE).\n","_attachments":{},"homepage":"https://github.com/lydell/line-numbers#readme","bugs":{"url":"https://github.com/lydell/line-numbers/issues"},"license":"MIT"}