{"id":18705606,"url":"https://github.com/angular-package/indexeddb","last_synced_at":"2026-01-23T00:55:20.224Z","repository":{"id":257806444,"uuid":"859344178","full_name":"angular-package/indexeddb","owner":"angular-package","description":"Wrapper for IndexedDB client-side storage.","archived":false,"fork":false,"pushed_at":"2024-10-02T15:51:52.000Z","size":274,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T10:15:18.653Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/angular-package.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["angular-package"],"patreon":"angularpackage","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2024-09-18T14:01:04.000Z","updated_at":"2024-10-02T15:51:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"0497bc1e-ffdb-4828-93b9-91e29ec88365","html_url":"https://github.com/angular-package/indexeddb","commit_stats":null,"previous_names":["angular-package/indexeddb"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-package%2Findexeddb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-package%2Findexeddb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-package%2Findexeddb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-package%2Findexeddb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angular-package","download_url":"https://codeload.github.com/angular-package/indexeddb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550619,"owners_count":21122934,"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":[],"created_at":"2024-11-07T12:11:28.306Z","updated_at":"2026-01-23T00:55:20.188Z","avatar_url":"https://github.com/angular-package.png","language":"TypeScript","funding_links":["https://github.com/sponsors/angular-package","https://patreon.com/angularpackage","https://img.shields.io/static/v1?label=Sponsor\u0026message=%E2%9D%A4\u0026logo=GitHub\u0026link=https://github.com/sponsors/angular-package","https://www.patreon.com/join/angularpackage/checkout?fan_landing=true\u0026rid=0"],"categories":[],"sub_categories":[],"readme":"# angular-package\n\n\u003ca href='https://angular-package.dev' target='_blank'\u003e\n  \u003cimg align=\"right\"  width=\"92\" height=\"92\" src=\"https://avatars.githubusercontent.com/u/31412194?s=400\u0026u=c9929aa36826318ccac8f7b84516e1ce3af7e21c\u0026v=4\" /\u003e\n\u003c/a\u003e\n\nThe angular-package supports the development process of [angular](https://angular.io)-based applications in varied ways through the thoughtful, reusable, easy-to-use small pieces of code called packages.\n\n## Indexeddb\n\nWrapper to IndexedDB client-side storage.\n\n[![Gitter][gitter-badge]][gitter-chat]\n[![Discord][discord-badge]][discord-channel]\n[![Twitter][twitter-badge]][twitter-follow]\n\n\u003c!-- npm badge --\u003e\n[![npm version][indexeddb-npm-badge-svg]][indexeddb-npm-badge]\n\n\u003c!-- GitHub badges --\u003e\n[![GitHub issues][indexeddb-badge-issues]][indexeddb-issues]\n[![GitHub forks][indexeddb-badge-forks]][indexeddb-forks]\n[![GitHub stars][indexeddb-badge-stars]][indexeddb-stars]\n[![GitHub license][indexeddb-badge-license]][indexeddb-license]\n\n\u003c!-- Sponsors --\u003e\n[![GitHub Sponsors][github-badge-sponsor]][github-sponsor-link]\n[![Patreon Sponsors][patreon-badge]][patreon-link]\n\n\u003cbr\u003e\n\nPackage is **free** to use. If you enjoy it, please consider donating via [fiat](https://docs.angular-package.dev/v/sass/donate/fiat), [Revolut platform](https://checkout.revolut.com/pay/048b10a3-0e10-42c8-a917-e3e9cb4c8e29) or [cryptocurrency](https://spectrecss.angular-package.dev/donate/thb-cryptocurrency) the [@angular-package](https://github.com/sponsors/angular-package) for further development. ♥  \n\n\u003e Feel **free** to submit a pull request. Help is always appreciated.\n\n\u003cbr\u003e\n\n## Table of contents\n\n* [Demonstration](#demonstration)\n* [Skeleton](#skeleton)\n* [Code scaffolding](#code-scaffolding)\n* [Example usage](#example-usage)\n* [Documentation](#documentation)\n  * [IDBConnection](#idbconnection) Class to open connection and create object store.\n  * [IDBData](#idbdata) Class with opened connection (IDBConnection), to handle transaction and store.\n  * [IDBQuery](#idbquery) Query store with JSON, by method-store or store-method.\n  * [IDBStore](#idbstore) Store methods with database connection (IDBData).\n  * [IDBConfig](#idbconfig) IDB configuration used in Angular IDBModule.\n  * [IDBModule](#idbmodule) Angular Module with indexeddb service.\n  * [IDBService](#idbservice) Angular Service with IndexedDB class.\n  * [IndexedDB](#indexeddb) Store and query for IndexedDB client-side storage.\n* [Changelog](#changelog)\n* [Git](#git)\n  * [Commit](#commit)\n  * [Versioning](#versioning)\n* [License](#license)\n\n\u003cbr\u003e\n\n## Demonstration\n\nDemonstration available [here](https://github.com/angular-package/indexeddb/tree/main/demo) as Angular 14 starter application.\n\n\u003cbr\u003e\n\n## Skeleton\n\nThis package was generated by the [skeleton workspace][skeleton] with [Angular CLI](https://github.com/angular/angular-cli) version `14.2.0`.\n\nCopy this package to the `packages/indexeddb` folder of the [skeleton workspace][skeleton] then run the commands below.\n\n\u003cbr\u003e\n\n## Code scaffolding\n\nRun `ng generate component component-name --project indexeddb` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project indexeddb`.\n\u003e Note: Don't forget to add `--project indexeddb` or else it will be added to the default project in your `angular.json` file.\n\n### Build\n\nRun `ng build indexeddb` to build the project. The build artifacts will be stored in the `dist/` directory.\n\n### Publishing\n\nAfter building your library with `ng build indexeddb`, go to the dist folder `cd dist/indexeddb` and run `npm publish`.\n\n## Running unit tests\n\nRun `ng test indexeddb` to execute the unit tests via [Karma](https://karma-runner.github.io).\n\n## Further help\n\nTo get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.\n\n\u003cbr\u003e\n\n## Example usage\n\nPrepare configuration.\n\n```typescript\n// config.ts\nimport { IndexedDB } from \"@angular-package/indexeddb\";\n\n// Config.\nexport const IDB_CONFIG = IndexedDB.config({\n  name: 'databasename',\n  storeNames: ['storename1', 'storename2'],\n  store: IndexedDB.store({\n    'storename1': {\n      keyPath: 'id',\n      autoIncrement: false,\n      index: [\n        { name: \"name\", keyPath: \"name\", options: { unique: false } },\n      ]\n    },\n    'storename2': {\n      keyPath: \"id\",\n      autoIncrement: true,\n      index: [\n        { name: \"name\", keyPath: \"name\", options: { unique: false } },\n        { name: \"position\", keyPath: \"position\", options: { unique: false } },\n        { name: \"weight\", keyPath: \"weight\", options: { unique: false } },\n        { name: \"symbol\", keyPath: \"symbol\", options: { unique: false } },\n      ],\n    },\n  }),\n  version: 1\n});\n```\n\nUse configuration and initialize database.\n\n```typescript\n// example.ts\nimport { IndexedDB } from \"@angular-package/indexeddb\";\nimport { IDB_CONFIG } from './config';\n\n// Initialize.\nconst indexeddb = new IndexedDB\u003c\n  // Create store interface.\n  {\n    storename1: {\n      id: number,\n      name: string\n    },\n    storename2: {\n      id: number,\n      name: string,\n      position: number,\n      weight: number,\n      symbol: string\n    }\n  }\n\u003e(\n  IDB_CONFIG.name,\n  IDB_CONFIG.storeNames,\n  IDB_CONFIG.store,\n  IDB_CONFIG.version\n);\n\n// Add by method\nindexeddb.query.method({\n  'add': {\n    'storename2': {\n      value: {\n        'id': 1,\n        'name': 'name',\n        'position': 1,\n        'symbol': 'N',\n        'weight': 100\n      },\n      'onsuccess': (result) =\u003e console.log(result),\n      'onerror': (ev) =\u003e console.log(`error`, ev),\n    }\n  }\n})\n\n// Get\nindexeddb.query.method({\n  'get': {\n    'storename2': {\n      'query': 1,\n      'onsuccess': (result =\u003e console.log(result)),\n      'onerror': () =\u003e console.log(`error`)\n    },\n  }\n});\n\n// Add by store\nindexeddb.query.store({\n  'storename1': {\n    'add': {\n      'value': {\n        'id': 2,\n        'name': 'item'\n      },\n      'onsuccess': (result) =\u003e console.log(result) \n    }\n  }\n})\n\n// Get\nindexeddb.query.store({\n  'storename1': {\n    'get': {\n      'query': 2,\n      'onsuccess': result =\u003e console.log(result)\n    }\n  }\n})\n```\n\n\u003cbr\u003e\n\n## Documentation\n\nThe documentation is in construction and it's available at [https://angular-package.gitbook.io/indexedb](https://angular-package.gitbook.io/indexedb)\n\n### IDBConnection\n\nClass to open connection and create object store.\n\n```typescript\nexport class IDBConnection\u003c\n  Name extends string = string,\n  StoreNames extends string | number | symbol = string,\n  Version extends number = number\n\u003e { ... }\n```\n\n[GitHub](https://github.com/angular-package/indexeddb/blob/main/src/lib/idb-connection.class.ts)\n\n### IDBData\n\nClass with opened connection (IDBConnection), to handle transaction and store.\n\n```typescript\nexport class IDBData\u003c\n  Name extends string = string,\n  StoreNames extends string | number | symbol = string,\n  Version extends number = number,\n\u003e { ... }\n```\n\n[GitHub](https://github.com/angular-package/indexeddb/blob/main/src/lib/idb-data.class.ts)\n\n### IDBQuery\n\nQuery store with JSON, by method-store or store-method.\n\n```typescript\nexport class IDBQuery\u003c\n  StoreSchema extends object,\n  Name extends string = string,\n  StoreNames extends keyof StoreSchema = keyof StoreSchema,\n  Version extends number = number\n\u003e { ... }\n```\n\n[GitHub](https://github.com/angular-package/indexeddb/blob/main/src/lib/idb-query.class.ts)\n\n### IDBStore\n\nStore methods with database connection (IDBData).\n\n```typescript\nexport class IDBStore\u003c\n  StoreSchema extends object,\n  Name extends string = string,\n  StoreNames extends keyof StoreSchema = keyof StoreSchema,\n  Version extends number = number,\n\u003e implements IDBStoreInterface\u003cStoreSchema, StoreNames\u003e {\n  ...\n}\n```\n\n[GitHub](https://github.com/angular-package/indexeddb/blob/main/src/lib/idb-store.class.ts)\n\n### IDBConfig\n\nIDB configuration used in Angular IDBModule.\n\n```typescript\nexport class IDBConfig\u003c\n  Name extends string = string,\n  StoreNames extends string | number | symbol = string,\n  Version extends number = number\n\u003e {\n  name?: Name;\n  storeNames?: StoreNames | StoreNames[];\n  store?: IDBStoreParameters\u003cStoreNames\u003e;\n  version?: Version;\n};\n```\n\n[GitHub](https://github.com/angular-package/indexeddb/blob/main/src/lib/idb.config.ts)\n\n### IDBModule\n\nAngular Module with indexeddb service.\n\n```typescript\n@NgModule({\n  declarations: [],\n  imports: [\n    CommonModule\n  ]\n})\nexport class IDBModule {\n  static forRoot(@Optional() @Inject(IDBConfig) config?: IDBConfig): ModuleWithProviders\u003cIDBModule\u003e {\n    return {\n      ngModule: IDBModule,\n      providers: [\n        IDBService,\n        {provide: IDBConfig, useValue: config, multi: false}\n      ]\n    }\n  }\n  static forChild(@Optional() @Inject(IDBConfig) config: IDBConfig): ModuleWithProviders\u003cIDBModule\u003e {\n    return {\n      ngModule: IDBModule,\n      providers: [\n        IDBService,\n        {provide: IDBConfig, useValue: config, multi: false}\n      ]\n    };\n  }\n}\n```\n\n[GitHub](https://github.com/angular-package/indexeddb/blob/main/src/lib/idb.module.ts)\n\n### IDBService\n\nAngular Service with IndexedDB class.\n\n```typescript\n@Injectable({\n  providedIn: \"root\",\n})\nexport class IDBService\u003c\n  StoreSchema extends object,\n  Name extends string = string,\n  StoreNames extends keyof StoreSchema = keyof StoreSchema,\n  Version extends number = number\n\u003e {\n  ...\n}\n```\n\n[GitHub](https://github.com/angular-package/indexeddb/blob/main/src/lib/idb.service.ts)\n\n### IndexedDB\n\nStore and query for IndexedDB client-side storage.\n\n```typescript\nexport class IndexedDB\u003c\n  StoreSchema extends object,\n  Name extends string = string,\n  StoreNames extends keyof StoreSchema = keyof StoreSchema,\n  Version extends number = number\n\u003e { ... }\n```\n\n[GitHub](https://github.com/angular-package/indexeddb/blob/main/src/lib/indexeddb.class.ts)\n\n\u003cbr\u003e\n\n## Changelog\n\nTo read it, click on the [CHANGELOG.md][indexeddb-github-changelog] link.\n\n\u003cbr\u003e\n\n## GIT\n\n### Commit\n\n* [AngularJS Git Commit Message Conventions][git-commit-angular]\n* [Karma Git Commit Msg][git-commit-karma]\n* [Conventional Commits][git-commit-conventional]\n\n### Versioning\n\n[Semantic Versioning 2.0.0][git-semver]\n\n**Given a version number MAJOR.MINOR.PATCH, increment the:**\n\n* MAJOR version when you make incompatible API changes,\n* MINOR version when you add functionality in a backwards-compatible manner, and\n* PATCH version when you make backwards-compatible bug fixes.\n\nAdditional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.\n\n**FAQ**\nHow should I deal with revisions in the 0.y.z initial development phase?\n\n\u003e The simplest thing to do is start your initial development release at 0.1.0 and then increment the minor version for each subsequent release.\n\nHow do I know when to release 1.0.0?\n\n\u003e If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you’re worrying a lot about backwards compatibility, you should probably already be 1.0.0.\n\n\u003cbr\u003e\n\n## License\n\nMIT © angular-package ([license][indexeddb-license])\n\n\u003c!-- Funding --\u003e\n[github-badge-sponsor]: https://img.shields.io/static/v1?label=Sponsor\u0026message=%E2%9D%A4\u0026logo=GitHub\u0026link=https://github.com/sponsors/angular-package\n[github-sponsor-link]: https://github.com/sponsors/angular-package\n[patreon-badge]: https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dangularpackage%26type%3Dpatrons\u0026style=flat\n[patreon-link]: https://www.patreon.com/join/angularpackage/checkout?fan_landing=true\u0026rid=0\n\n[angulario]: https://angular.io\n[skeleton]: https://github.com/angular-package/skeleton\n\n\u003c!-- Update status --\u003e\n[experimental]: https://img.shields.io/badge/-Experimental-orange\n[fix]: https://img.shields.io/badge/-Fix-red\n[new]: https://img.shields.io/badge/-eNw-green\n[update]: https://img.shields.io/badge/-Update-red\n[documentation]: https://img.shields.io/badge/-Documentation-informational\n[demonstration]: https://img.shields.io/badge/-Demonstration-green\n\n\u003c!-- Discord --\u003e\n[discord-badge]: https://img.shields.io/discord/925168966098386944?style=social\u0026logo=discord\u0026label=Discord\n[discord-channel]: https://discord.com/invite/rUCR2CW75G\n\n\u003c!-- Gitter --\u003e\n[gitter-badge]: https://img.shields.io/gitter/room/angular-package/ap-sass?style=social\u0026logo=gitter\n[gitter-chat]: https://app.gitter.im/#/room/#ap-sass:gitter.im\n\n\u003c!-- Twitter --\u003e\n[twitter-badge]: https://img.shields.io/twitter/follow/angularpackage?label=%40angularpackage\u0026style=social\n[twitter-follow]: https://twitter.com/angularpackage\n\n\u003c!-- GIT --\u003e\n[git-semver]: http://semver.org/\n\n\u003c!-- GIT: commit --\u003e\n[git-commit-angular]: https://gist.github.com/stephenparish/9941e89d80e2bc58a153\n[git-commit-karma]: http://karma-runner.github.io/0.10/dev/git-commit-msg.html\n[git-commit-conventional]: https://www.conventionalcommits.org/en/v1.0.0/\n\n\u003c!-- This package: sass  --\u003e\n  \u003c!-- GitHub: badges --\u003e\n  [indexeddb-badge-issues]: https://img.shields.io/github/issues/angular-package/indexeddb\n  [indexeddb-badge-forks]: https://img.shields.io/github/forks/angular-package/indexeddb\n  [indexeddb-badge-stars]: https://img.shields.io/github/stars/angular-package/indexeddb\n  [indexeddb-badge-license]: https://img.shields.io/github/license/angular-package/indexeddb\n  \u003c!-- GitHub: badges links --\u003e\n  [indexeddb-issues]: https://github.com/angular-package/indexeddb/issues\n  [indexeddb-forks]: https://github.com/angular-package/indexeddb/network\n  [indexeddb-license]: https://github.com/angular-package/indexeddb/blob/master/LICENSE\n  [indexeddb-stars]: https://github.com/angular-package/indexeddb/stargazers\n\u003c!-- This package --\u003e\n  [indexeddb-github-changelog]: https://github.com/angular-package/indexeddb/blob/main/CHANGELOG.md\n\n\u003c!-- Package: indexeddb --\u003e\n  \u003c!-- npm --\u003e\n  [indexeddb-npm-badge-svg]: https://badge.fury.io/js/@angular-package%2Findexeddb.svg\n  [indexeddb-npm-badge-png]: https://badge.fury.io/js/@angular-package%2Findexeddb.png\n  [indexeddb-npm-badge]: https://badge.fury.io/js/@angular-package%2Findexeddb\n  [indexeddb-npm-readme]: https://www.npmjs.com/package/@angular-package/indexeddb#readme\n\n  \u003c!-- GitHub --\u003e\n  [indexeddb-github-readme]: https://github.com/angular-package/indexeddb#readme\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular-package%2Findexeddb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangular-package%2Findexeddb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular-package%2Findexeddb/lists"}