{"name":"index-to-position","version":"0.1.2","description":"Convert a string index to its line and column position","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/index-to-position.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsc index.d.ts"},"keywords":["index","position","line","column","text","coordinate","string","character","line number","column number","location"],"devDependencies":{"ava":"^5.3.1","typescript":"^5.2.2","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"8ee2f2d4a22af22da43949a4fec6aa0c8d7bcf84","bugs":{"url":"https://github.com/sindresorhus/index-to-position/issues"},"homepage":"https://github.com/sindresorhus/index-to-position#readme","_id":"index-to-position@0.1.2","_nodeVersion":"20.9.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==","shasum":"e11bfe995ca4d8eddb1ec43274488f3c201a7f09","tarball":"http://registry-npm.ywwl.com/index-to-position/download/index-to-position-0.1.2.tgz","fileCount":5,"unpackedSize":4014,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdB2xPW4Zhc4wEzQQsbN8dVH0QhEVYL3NMOLJZ29JgLQIgZvsfcmPcPtO7GcKsnpSUOy7qfyIHJhgx6VrmTRpplkY="}],"size":1981,"noattachment":false,"key":"/index-to-position/-/index-to-position-0.1.2.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/index-to-position_0.1.2_1699533729905_0.538676877297793"},"_hasShrinkwrap":false,"readme":"# index-to-position\n\n> Convert a string index to its line and column position\n\n## Install\n\n```sh\nnpm install index-to-position\n```\n\n## Usage\n\n```js\nimport indexToPosition from 'index-to-position';\n\nindexToPosition('hello\\nworld\\n!', 7);\n//=> {line: 1, column: 1}\n```\n\n## API\n\n### `indexToPosition(text, index, options?)`\n\n#### text\n\nType: `string`\n\nThe text in which to find the line and column position.\n\n#### index\n\nType: `number`\n\nThe index in the string for which to find the line and column position.\n\n#### options\n\nType: `object`\n\n##### oneBased\n\nType: `boolean`\\\nDefault: `false`\n\nWhether to use 1-based or 0-based indexing for the result.\n","publish_time":1699533730136,"_cnpm_publish_time":1699533730136,"dist-tags":{"latest":"1.2.0"}}