{"_id":"@cjser/index-to-position","name":"@cjser/index-to-position","dist-tags":{"latest":"1.2.0-cjser.2"},"versions":{"1.2.0-cjser.2":{"name":"@cjser/index-to-position","version":"1.2.0-cjser.2","description":"Convert a string index to its line and column position","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.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","require":"./dist-cjser/index.cjs","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","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"1.2.0","cjserVersion":2,"original":{"name":"index-to-position","version":"1.2.0","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"sindresorhus/index-to-position","files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsc index.d.ts"}}},"_id":"@cjser/index-to-position@1.2.0-cjser.2","gitHead":"0168e4aac54a1a9ca6f921419fa5ed9edb53ef4a","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-+EX0CMEvUrY84j81K5vnqQ43FuL/gZtUlaFp7V6h68lKVxBJ1wclanWpV0NmH0hAwh36VqfBcpifqbjwwlCVAA==","shasum":"ab7e184d08b851316f1391d1cd045d9be2cbdb14","tarball":"https://registry.npmjs.org/@cjser/index-to-position/-/index-to-position-1.2.0-cjser.2.tgz","fileCount":6,"unpackedSize":7618,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBaxNa/itXePBiqTvzAQcLWdivVeuXCZHc5dOg+1I9uVAiA5nd3It0kuZYwvG28vqbV51NW9J1bNJpbIA1bD9L0+4w=="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/index-to-position_1.2.0-cjser.2_1778130603637_0.017841420128597907"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T05:10:03.521Z","1.2.0-cjser.2":"2026-05-07T05:10:03.780Z","modified":"2026-05-07T05:10:04.018Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Convert a string index to its line and column position","keywords":["index","position","line","column","text","coordinate","string","character","line number","column number","location"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","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\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/index-to-position\n","readmeFilename":"readme.md","_rev":"1-a1cfd28857055733e630f08d74da448f"}