{"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":"http://registry-npm.ywwl.com/index-to-position/download/index-to-position-1.2.0.tgz","fileCount":5,"unpackedSize":4697,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC4ZGUeSDbP8TpjqF7yRUg1p07ocAPZ7gXZ84NvgSgHmAIgSDGKH9oxbJJyIY+ZT51gQA4/oU/o/LOskczAQFq2W9k="}],"size":2099,"noattachment":false,"key":"/index-to-position/-/index-to-position-1.2.0.tgz"},"_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,"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","publish_time":1758773015523,"_cnpm_publish_time":1758773015523,"dist-tags":{"latest":"1.2.0"}}