{"id":23084154,"url":"https://github.com/localforage/localforage-startswith","last_synced_at":"2026-03-11T03:03:03.853Z","repository":{"id":32020050,"uuid":"35591246","full_name":"localForage/localForage-startsWith","owner":"localForage","description":"Adds startsWith method to localForage.","archived":false,"fork":false,"pushed_at":"2017-10-28T13:28:34.000Z","size":52,"stargazers_count":24,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-13T06:55:25.413Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/localForage.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2015-05-14T04:45:11.000Z","updated_at":"2023-10-24T14:03:22.000Z","dependencies_parsed_at":"2022-08-24T14:22:43.354Z","dependency_job_id":null,"html_url":"https://github.com/localForage/localForage-startsWith","commit_stats":null,"previous_names":["thgreasi/localforage-startswith"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/localForage/localForage-startsWith","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localForage%2FlocalForage-startsWith","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localForage%2FlocalForage-startsWith/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localForage%2FlocalForage-startsWith/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localForage%2FlocalForage-startsWith/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/localForage","download_url":"https://codeload.github.com/localForage/localForage-startsWith/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localForage%2FlocalForage-startsWith/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30368591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-12-16T15:49:16.320Z","updated_at":"2026-03-11T03:03:03.831Z","avatar_url":"https://github.com/localForage.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"localForage-startsWith\n======================\n[![npm](https://img.shields.io/npm/dm/localforage-startswith.svg)](https://www.npmjs.com/package/localforage-startswith)  \nAdds startsWith method to [localForage](https://github.com/mozilla/localForage).\n\n\n## Requirements\n\n* [localForage](https://github.com/mozilla/localForage) v1.4.0+\n  * for earlier versions of localforage, please use the v1.1.x releases\n\n## Installation\n`npm i localforage-startswith`\n\n## Importing\n\nAdding a `\u003cscript\u003e` reference to your page will extend the localforage object to also include the `.startsWith()`.\n\n### TypeScript\n\n[Include `localforage` with an import statement appropriate for your configuration](https://github.com/localForage/localForage/blob/master/README.md#typescript) and import `localforage-startswith` right after it.\n\nNormally, `localforage-startswith` will extend the prototype of `locaforage` to include the `startsWith()` method, but unfortunately the typings can't be updated. As a result you should use the exported `extendPrototype()` method, which returns the provided localforage instance but with inherited typings that also include the `startsWith()` method.\n\n```javascript\nimport localForage from 'localforage';\n// OR based on your configuration:\n// import * as localForage from 'localforage';\n\nimport { extendPrototype } from 'localforage-startswith';\n\nextendPrototype(localforage);\n\n// Keep using localForage as usual.\n```\n\n### Known issues with module bundlers\n\nIn some ES6 module bundlers `.startsWith()` might not automatically be made available to the `localforage` object on import.\nIn this case, import the provided `extendPrototype()` method and extend `localforage` manually, as shown in the Typescript section.\n\n\n## API\n\n### startsWith(keyPrefix)\n\nRetrieves an object with all the items that have keys starting with the provided parameter.\n```js\nlocalforage.startsWith('user-1').then(function(results) {\n  console.log(results);\n  // prints:\n  // {\n  //   'user-1-todo-1': \"11aa1111bbcc\",\n  //   'user-1-todo-2': \"22aa2222bbcc\",\n  //   'user-1-todo-3': \"33aa3333bbcc\",\n  //   'user-1-todo-4': \"44aa4444bbcc\"\n  // }\n});\n```\n\n### keysStartingWith(keyPrefix)\n\nRetrieves an array with all the keys starting with the provided parameter.\n```js\nlocalforage.keysStartingWith('user-1').then(function(results) {\n  console.log(results);\n  // prints:\n  // [\n  //   'user-1-todo-1',\n  //   'user-1-todo-2',\n  //   'user-1-todo-3',\n  //   'user-1-todo-4'\n  // ]\n});\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalforage%2Flocalforage-startswith","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocalforage%2Flocalforage-startswith","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalforage%2Flocalforage-startswith/lists"}