{"_id":"index-to-position","_rev":"6-c7ff3aede6f804899cd697d516f259ef","name":"index-to-position","dist-tags":{"latest":"1.2.0"},"versions":{"0.1.0":{"name":"index-to-position","version":"0.1.0","keywords":["index","position","line","column","text","coordinate","string","character","line number","column number","location"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"index-to-position@0.1.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/index-to-position#readme","bugs":{"url":"https://github.com/sindresorhus/index-to-position/issues"},"dist":{"shasum":"9723e10d73190ab5f176d128703112d1d1ee6a3e","tarball":"https://registry.npmjs.org/index-to-position/-/index-to-position-0.1.0.tgz","fileCount":5,"integrity":"sha512-I6PLk0E6Jk8t/W212xp9euPed30tIN9mYdslb0Vkd03hG9sd0pByboBdtIRL+Y/103JLp1alP3OuMgxfbIQyFw==","signatures":[{"sig":"MEYCIQC5zl4LBZb6GOTGKHrGhAG8tzGhNDlu+8TCnZ+5NcbwGwIhAIIq8hnsjgXgyMURz7ImuKtsyipxbK9z/9gJ3G9qCcyn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3703},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"9f4bbcd62bab821eeb72ab6777e60536f8d61621","scripts":{"test":"xo && ava && tsc index.d.ts"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/index-to-position.git","type":"git"},"_npmVersion":"9.2.0","description":"Convert a string index to its line and column position","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.56.0","ava":"^5.3.1","typescript":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/index-to-position_0.1.0_1698951967600_0.7482504376634735","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"index-to-position","version":"0.1.1","keywords":["index","position","line","column","text","coordinate","string","character","line number","column number","location"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"index-to-position@0.1.1","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/index-to-position#readme","bugs":{"url":"https://github.com/sindresorhus/index-to-position/issues"},"dist":{"shasum":"7c7abf3f9ffd20dd3ec9a09995dbba3a68069a9b","tarball":"https://registry.npmjs.org/index-to-position/-/index-to-position-0.1.1.tgz","fileCount":5,"integrity":"sha512-9VI2GKITENQfskAToKRYaOgulVD/lq2/KfVDEbaa/REbCXxmlnJCmF6KH1Ew16/Fq7lWvFa6r0OHouue5qHm9g==","signatures":[{"sig":"MEUCIQD4zlhKzMYKWKnG5B1PXOMYXxmWi9albXfHAS4fJ+zYFwIgKyYcn/RO/EycCC3/2F5HfY3d21HTrhH1q55XL42lfBY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3708},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"ea58ae3ea94e768ae05478ff3202b0632f5f6f84","scripts":{"test":"xo && ava && tsc index.d.ts"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/index-to-position.git","type":"git"},"_npmVersion":"9.2.0","description":"Convert a string index to its line and column position","directories":{},"sideEffects":false,"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.56.0","ava":"^5.3.1","typescript":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/index-to-position_0.1.1_1699527388599_0.8345355585015013","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"index-to-position","version":"0.1.2","keywords":["index","position","line","column","text","coordinate","string","character","line number","column number","location"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"index-to-position@0.1.2","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/index-to-position#readme","bugs":{"url":"https://github.com/sindresorhus/index-to-position/issues"},"dist":{"shasum":"e11bfe995ca4d8eddb1ec43274488f3c201a7f09","tarball":"https://registry.npmjs.org/index-to-position/-/index-to-position-0.1.2.tgz","fileCount":5,"integrity":"sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==","signatures":[{"sig":"MEUCIQDdB2xPW4Zhc4wEzQQsbN8dVH0QhEVYL3NMOLJZ29JgLQIgZvsfcmPcPtO7GcKsnpSUOy7qfyIHJhgx6VrmTRpplkY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4014},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"8ee2f2d4a22af22da43949a4fec6aa0c8d7bcf84","scripts":{"test":"xo && ava && tsc index.d.ts"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/index-to-position.git","type":"git"},"_npmVersion":"9.2.0","description":"Convert a string index to its line and column position","directories":{},"sideEffects":false,"_nodeVersion":"20.9.0","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.56.0","ava":"^5.3.1","typescript":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/index-to-position_0.1.2_1699533729905_0.538676877297793","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"index-to-position","version":"1.0.0","keywords":["index","position","line","column","text","coordinate","string","character","line number","column number","location"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"index-to-position@1.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/index-to-position#readme","bugs":{"url":"https://github.com/sindresorhus/index-to-position/issues"},"dist":{"shasum":"baca236eb6e8c2b750b9225313c31751f84ef357","tarball":"https://registry.npmjs.org/index-to-position/-/index-to-position-1.0.0.tgz","fileCount":5,"integrity":"sha512-sCO7uaLVhRJ25vz1o8s9IFM3nVS4DkuQnyjMwiQPKvQuBYBDmb8H7zx8ki7nVh4HJQOdVWebyvLE0qt+clruxA==","signatures":[{"sig":"MEQCIGnTjpNTI8Uqu8Rhw/b8xKQI9SWa595jEyGLgxS5UbMXAiBQIzL3ZZf1Ma8Xru/ZUIu6atlpNAZ0bGtNWB65pCB11g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4215},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"6bdad23a21c01948727f00b369c97828e0ce572d","scripts":{"test":"xo && ava && tsc index.d.ts"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/index-to-position.git","type":"git"},"_npmVersion":"9.2.0","description":"Convert a string index to its line and column position","directories":{},"sideEffects":false,"_nodeVersion":"21.6.2","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.56.0","ava":"^5.3.1","typescript":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/index-to-position_1.0.0_1709133920482_0.8124525494602386","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"index-to-position","version":"1.1.0","keywords":["index","position","line","column","text","coordinate","string","character","line number","column number","location"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"index-to-position@1.1.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/index-to-position#readme","bugs":{"url":"https://github.com/sindresorhus/index-to-position/issues"},"dist":{"shasum":"2e50bd54c8040bdd6d9b3d95ec2a8fedf86b4d44","tarball":"https://registry.npmjs.org/index-to-position/-/index-to-position-1.1.0.tgz","fileCount":5,"integrity":"sha512-XPdx9Dq4t9Qk1mTMbWONJqU7boCoumEH7fRET37HX5+khDUl3J2W6PdALxhILYlIYx2amlwYcRPp28p0tSiojg==","signatures":[{"sig":"MEYCIQDDw396w/W1ZhUHWFKYr21MU4TejDwhTRfVN/zvwPV+fAIhALTCK9neHS8xC1C235oaLHKdoPsMPFFE6BaghwjtJoVb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4045},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"5c444e5259f1a62675be9865454f5bd920e8c895","scripts":{"test":"xo && ava && tsc index.d.ts"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/index-to-position.git","type":"git"},"_npmVersion":"10.9.2","description":"Convert a string index to its line and column position","directories":{},"sideEffects":false,"_nodeVersion":"23.6.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.56.0","ava":"^5.3.1","typescript":"^5.2.2"},"_npmOperationalInternal":{"tmp":"tmp/index-to-position_1.1.0_1744138276732_0.742649554305973","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"index-to-position","version":"1.2.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"},"_id":"index-to-position@1.2.0","gitHead":"f87c83a187959bb0afd80f0a642d04b09c27610d","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/index-to-position/issues"},"homepage":"https://github.com/sindresorhus/index-to-position#readme","_nodeVersion":"20.19.5","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==","shasum":"c800eb34dacf4dbf96b9b06c7eb78d5f704138b4","tarball":"https://registry.npmjs.org/index-to-position/-/index-to-position-1.2.0.tgz","fileCount":5,"unpackedSize":4697,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC4ZGUeSDbP8TpjqF7yRUg1p07ocAPZ7gXZ84NvgSgHmAIgSDGKH9oxbJJyIY+ZT51gQA4/oU/o/LOskczAQFq2W9k="}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/index-to-position_1.2.0_1758773015328_0.588292623653778"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-02T19:06:07.600Z","modified":"2025-09-25T04:03:35.705Z","0.1.0":"2023-11-02T19:06:07.817Z","0.1.1":"2023-11-09T10:56:28.766Z","0.1.2":"2023-11-09T12:42:10.136Z","1.0.0":"2024-02-28T15:25:20.629Z","1.1.0":"2025-04-08T18:51:16.928Z","1.2.0":"2025-09-25T04:03:35.523Z"},"bugs":{"url":"https://github.com/sindresorhus/index-to-position/issues"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","homepage":"https://github.com/sindresorhus/index-to-position#readme","keywords":["index","position","line","column","text","coordinate","string","character","line number","column number","location"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/index-to-position.git"},"description":"Convert a string index to its line and column position","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"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\n##### oneBasedLine\n\nType: `boolean`\\\nDefault: `false`\n\nWhether to use 1-based or 0-based line indexing for the result.\n\n##### oneBasedColumn\n\nType: `boolean`\\\nDefault: `false`\n\nWhether to use 1-based or 0-based column indexing for the result.\n","readmeFilename":"readme.md"}