{"_id":"add-line-numbers","_rev":"398736","name":"add-line-numbers","description":"adds line numbers to a source string","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"time":{"modified":"2021-08-04T04:23:20.000Z","created":"2015-06-23T21:23:56.658Z","1.0.1":"2015-06-23T21:25:03.451Z","1.0.0":"2015-06-23T21:23:56.658Z"},"users":{},"author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"repository":{"type":"git","url":"git://github.com/Jam3/add-line-numbers.git"},"versions":{"1.0.1":{"name":"add-line-numbers","version":"1.0.1","description":"adds line numbers to a source string","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"pad-left":"^1.0.2"},"devDependencies":{"faucet":"0.0.1","get-stdin":"^4.0.1","tape":"^4.0.0"},"scripts":{"test":"node test.js | faucet"},"keywords":["add","line","numbers","pad","left","padding","pads","space","indent","num"],"repository":{"type":"git","url":"git://github.com/Jam3/add-line-numbers.git"},"homepage":"https://github.com/Jam3/add-line-numbers","bugs":{"url":"https://github.com/Jam3/add-line-numbers/issues"},"gitHead":"f29c9dbecfb3fb5b8b9ab3f6fa4ef0593f3b0d42","_id":"add-line-numbers@1.0.1","_shasum":"48dbbdea47dbd234deafeac6c93cea6f70b4b7e3","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"dist":{"shasum":"48dbbdea47dbd234deafeac6c93cea6f70b4b7e3","size":2039,"noattachment":false,"key":"/add-line-numbers/-/add-line-numbers-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/add-line-numbers/download/add-line-numbers-1.0.1.tgz"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"directories":{},"publish_time":1435094703451,"_cnpm_publish_time":1435094703451,"_hasShrinkwrap":false},"1.0.0":{"name":"add-line-numbers","version":"1.0.0","description":"adds line numbers to a source string","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"pad-left":"^1.0.2"},"devDependencies":{"faucet":"0.0.1","get-stdin":"^4.0.1","tape":"^4.0.0"},"scripts":{"test":"node test.js | faucet"},"keywords":["add","line","numbers","pad","left","padding","pads","space","indent","num"],"repository":{"type":"git","url":"git://github.com/Jam3/add-line-numbers.git"},"homepage":"https://github.com/Jam3/add-line-numbers","bugs":{"url":"https://github.com/Jam3/add-line-numbers/issues"},"gitHead":"e25f90c9b7edf46d96694d9c71b4c50a892e8251","_id":"add-line-numbers@1.0.0","_shasum":"c1c85ba80cb3ea63adbfd7892157a36b5deacefd","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"dist":{"shasum":"c1c85ba80cb3ea63adbfd7892157a36b5deacefd","size":2086,"noattachment":false,"key":"/add-line-numbers/-/add-line-numbers-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/add-line-numbers/download/add-line-numbers-1.0.0.tgz"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"directories":{},"publish_time":1435094636658,"_cnpm_publish_time":1435094636658,"_hasShrinkwrap":false}},"readme":"# add-line-numbers\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nAdds line numbers to a source string, padding left and starting at the given offset.\n\n## Example\n\n#### example.js\n\n```js\nvar addLineNumbers = require('add-line-numbers')\nvar stdin = require('get-stdin')\n\nstdin(function (body) {\n  var src = addLineNumbers(body.toString())\n  process.stdout.write(src + '\\n')\n})\n```\n\nNow run the following in bash:\n\n```sh\nnode example.js < some-file.js\n```\n\nResulting output:\n\n```js\n 1: var addLineNumbers = require('./')\n 2: var test = require('tape')\n 3: \n 4: test('adds line numbers to a source string', function (t) {\n 5:   t.equal(addLineNumbers([\n 6:     'one',\n 7:     'is second'\n 8:   ].join('\\r\\n')), '1: one\\n2: is second', 'return carriage')\n 9: \n10:   t.equal(addLineNumbers([\n11:     'one',\n12:     'is second'\n13:   ].join('\\n'), 0), '0: one\\n1: is second', 'start offset')\n14: \n...\n```\n\n## Usage\n\n[![NPM](https://nodei.co/npm/add-line-numbers.png)](https://www.npmjs.com/package/add-line-numbers)\n\n#### `str = addLineNumbers(str, start, delimiter)`\n\nAdds a number to the start of each line in the `str` text. \n\n- `start` (Number) number to start counting at, defaults to 1\n- `delimiter` (String) joins the number and line, defaults to `\": \"`\n\nReturns the transformed string.\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/Jam3/add-line-numbers/blob/master/LICENSE.md) for details.\n","_attachments":{},"homepage":"https://github.com/Jam3/add-line-numbers","bugs":{"url":"https://github.com/Jam3/add-line-numbers/issues"},"license":"MIT"}