{"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":"http://registry-npm.ywwl.com/index-to-position/download/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,"size":1977,"noattachment":false,"key":"/index-to-position/-/index-to-position-1.1.0.tgz"},"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"},"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":1744138276928,"_cnpm_publish_time":1744138276928,"dist-tags":{"latest":"1.2.0"}}