{"name":"index-to-position","version":"1.0.0","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":"6bdad23a21c01948727f00b369c97828e0ce572d","bugs":{"url":"https://github.com/sindresorhus/index-to-position/issues"},"homepage":"https://github.com/sindresorhus/index-to-position#readme","_id":"index-to-position@1.0.0","_nodeVersion":"21.6.2","_npmVersion":"9.2.0","dist":{"integrity":"sha512-sCO7uaLVhRJ25vz1o8s9IFM3nVS4DkuQnyjMwiQPKvQuBYBDmb8H7zx8ki7nVh4HJQOdVWebyvLE0qt+clruxA==","shasum":"baca236eb6e8c2b750b9225313c31751f84ef357","tarball":"http://registry-npm.ywwl.com/index-to-position/download/index-to-position-1.0.0.tgz","fileCount":5,"unpackedSize":4215,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGnTjpNTI8Uqu8Rhw/b8xKQI9SWa595jEyGLgxS5UbMXAiBQIzL3ZZf1Ma8Xru/ZUIu6atlpNAZ0bGtNWB65pCB11g=="}],"size":2076,"noattachment":false,"key":"/index-to-position/-/index-to-position-1.0.0.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_1.0.0_1709133920482_0.8124525494602386"},"_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":1709133920629,"_cnpm_publish_time":1709133920629,"dist-tags":{"latest":"1.2.0"}}