{"name":"index-to-position","version":"0.1.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"},"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":"9f4bbcd62bab821eeb72ab6777e60536f8d61621","bugs":{"url":"https://github.com/sindresorhus/index-to-position/issues"},"homepage":"https://github.com/sindresorhus/index-to-position#readme","_id":"index-to-position@0.1.0","_nodeVersion":"18.18.2","_npmVersion":"9.2.0","dist":{"integrity":"sha512-I6PLk0E6Jk8t/W212xp9euPed30tIN9mYdslb0Vkd03hG9sd0pByboBdtIRL+Y/103JLp1alP3OuMgxfbIQyFw==","shasum":"9723e10d73190ab5f176d128703112d1d1ee6a3e","tarball":"http://registry-npm.ywwl.com/index-to-position/download/index-to-position-0.1.0.tgz","fileCount":5,"unpackedSize":3703,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5zl4LBZb6GOTGKHrGhAG8tzGhNDlu+8TCnZ+5NcbwGwIhAIIq8hnsjgXgyMURz7ImuKtsyipxbK9z/9gJ3G9qCcyn"}],"size":1868,"noattachment":false,"key":"/index-to-position/-/index-to-position-0.1.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_0.1.0_1698951967600_0.7482504376634735"},"_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":1698951967817,"_cnpm_publish_time":1698951967817,"dist-tags":{"latest":"1.2.0"}}