{"id":20458614,"url":"https://github.com/mahdita97/range-at-index-typescript","last_synced_at":"2026-04-21T13:31:57.595Z","repository":{"id":65154800,"uuid":"584735303","full_name":"MahdiTa97/range-at-index-typescript","owner":"MahdiTa97","description":"A Typescript package that returns a Range instance selecting text within an HTML Element, at start and end offsets Stars","archived":false,"fork":false,"pushed_at":"2023-01-11T07:41:50.000Z","size":183,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T08:32:19.552Z","etag":null,"topics":["browser","dom","index","iterate","javascript","offset","range","text","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/range-at-index-typescript","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MahdiTa97.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-03T11:36:38.000Z","updated_at":"2024-03-17T19:50:13.000Z","dependencies_parsed_at":"2023-02-09T02:16:22.551Z","dependency_job_id":null,"html_url":"https://github.com/MahdiTa97/range-at-index-typescript","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahdiTa97%2Frange-at-index-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahdiTa97%2Frange-at-index-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahdiTa97%2Frange-at-index-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahdiTa97%2Frange-at-index-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MahdiTa97","download_url":"https://codeload.github.com/MahdiTa97/range-at-index-typescript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242014658,"owners_count":20057875,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","dom","index","iterate","javascript","offset","range","text","typescript"],"created_at":"2024-11-15T12:13:13.789Z","updated_at":"2026-04-21T13:31:57.539Z","avatar_url":"https://github.com/MahdiTa97.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Range-at-Index-Typescript\n\nA Typescript package that returns a Range instance selecting text within an HTML Element, at start and end offsets Stars\n\n## Installation\n\n```bash\nnpm install range-at-index-typescript\n```\n\nor\n\n```bash\nyarn add range-at-index-typescript\n```\n\n## Usage\n\n```ts\nimport { rangeAtIndex } from 'range-at-index-typescript';\n```\n\nor\n\n```ts\nconst { rangeAtIndex } = require('range-at-index-typescript');\n```\n\n### API Documentation\n\n```ts\nRangeAtIndex({ el, index, offset, range }: {\n    el: Element;\n    index?: number;\n    offset?: number;\n    range?: Range;\n}): Range\n```\n\n## For Contributes\n\n### Commands\n\nThe main files are inside `/src`.\n\nTo run project, use:\n\n```bash\nnpm install\n```\n\nthen\n\n```bash\nnpm run start # or yarn start\n```\n\nThis builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.\n\nTo do a one-off build, use `npm run build` or `yarn build`.\n\nTo run tests, use `npm test` or `yarn test`.\n\n### Configuration\n\nCode quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly.\n\n### Jest\n\nJest tests are set up to run with `npm test` or `yarn test`.\n\n### Bundle Analysis\n\n[`size-limit`](https://github.com/ai/size-limit) is set up to calculate the real cost of your library with `npm run size` and visualize the bundle with `npm run analyze`.\n\n### Continuous Integration\n\n### GitHub Actions\n\nTwo actions are added by default:\n\n- `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix\n- `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit)\n\n### Optimizations\n\nPlease see the main [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations:\n\n```js\n// ./types/index.d.ts\ndeclare var __DEV__: boolean;\n\n// inside your code...\nif (__DEV__) {\n  console.log('foo');\n}\n```\n\nYou can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions.\n\n### Module Formats\n\nCJS, ESModules, and UMD module formats are supported.\n\nThe appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found.\n\n### Named Exports\n\n[always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahdita97%2Frange-at-index-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahdita97%2Frange-at-index-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahdita97%2Frange-at-index-typescript/lists"}