{"id":27320318,"url":"https://github.com/jagannathbhat/async-storage-db","last_synced_at":"2026-05-09T07:03:22.679Z","repository":{"id":46313361,"uuid":"297915122","full_name":"jagannathBhat/async-storage-db","owner":"jagannathBhat","description":"Offline persistent database for react native based on Async Storage. Developed by combining PouchDB and Async Storage.","archived":false,"fork":false,"pushed_at":"2021-10-31T11:17:29.000Z","size":235,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T16:59:27.706Z","etag":null,"topics":["nodejs","npm","npm-package","react-native"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/async-storage-db","language":"JavaScript","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/jagannathBhat.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":"2020-09-23T09:12:33.000Z","updated_at":"2021-11-16T12:40:10.000Z","dependencies_parsed_at":"2022-08-23T01:20:44.671Z","dependency_job_id":null,"html_url":"https://github.com/jagannathBhat/async-storage-db","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagannathBhat%2Fasync-storage-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagannathBhat%2Fasync-storage-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagannathBhat%2Fasync-storage-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagannathBhat%2Fasync-storage-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jagannathBhat","download_url":"https://codeload.github.com/jagannathBhat/async-storage-db/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550629,"owners_count":21122930,"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":["nodejs","npm","npm-package","react-native"],"created_at":"2025-04-12T09:46:42.293Z","updated_at":"2026-05-09T07:03:17.643Z","avatar_url":"https://github.com/jagannathBhat.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# async-storage-db\n\nA simple, asynchronous, unencrypted, persistent, JSON based JavaScript database for React Native.\n\nThis package is deprecated. Please find similar packages in https://reactnative.directory/\n\n## Installation\n\n### Get library\n\n#### npm\n\n```bash\nnpm install async-storage-db\n```\n\n#### yarn\n\n```bash\nyarn add async-storage-db\n```\n\n## Usage\n\n### Importing\n\n```js\nimport AsyncStorageDB from 'async-storage-db'\n```\n\n## API\n\nAsyncStorageDB has an asynchronous API, supporting promises, and async functions. Most of the API is exposed as:\n\n```js\ndb.doSomething(args...)\n```\n\n### Create a database\n\n```js\nconst db = new AsyncStorageDB([name])\n```\n\nThis method creates a database or opens an existing one.\n\n**Example**:\n\n```js\nconst db = new AsyncStorageDB('test')\n```\n\n`.info()` can be used to confirm the creation of the database. It returns the name of the database.\n\n```js\ndb.info()\n// test\n```\n\n### Delete a database\n\n```js\ndb.destroy()\n```\n\nDelete the database.\n\n### Create/update a document\n\n```js\ndb.post(doc)\n```\n\nCreates a new document or updates an existing document. To create a new document, the `doc` must contain the content of the document. The document ID must be provided in the `doc` while updating, as the \\_id property. While creating a new document, if \\_id property is provided in `doc`, it will be used as the ID of the document created, otherwise a new uuid will be assigned as the document ID.\n\n**Example (creating without ID)**:\n\n```js\ndb.post({ foo: 'bar' })\n\t.then(res =\u003e {\n\t\tconsole.log(res)\n\t\t// { foo: 'bar' }\n\t})\n\t.catch(err =\u003e {\n\t\t// handle error\n\t})\n```\n\n**Example (creating with ID / updating)**:\n\n```js\ndb.post({ _id: 'test_doc', foo: 'bar' })\n\t.then(res =\u003e {\n\t\tconsole.log(res)\n\t\t// { _id: 'test_doc', foo: 'bar' }\n\t})\n\t.catch(err =\u003e {\n\t\t// handle error\n\t})\n```\n\n### Fetch a document\n\n```js\ndb.get(id)\n```\n\nRetrieves a document whose ID is specified by `id`.\n\n**Example**:\n\n```js\ndb.get('test_doc')\n\t.then(res =\u003e {\n\t\tconsole.log(res)\n\t\t// { _id: 'test_doc', foo: 'bar' }\n\t})\n\t.catch(err =\u003e {\n\t\t// handle error\n\t})\n```\n\n### Delete a document\n\n```js\ndb.remove(id)\n```\n\nDeletes the document whose ID is specified by `id`.\n\n**Example**:\n\n```js\ndb.remove('test_doc')\n\t.then(res =\u003e {\n\t\tconsole.log(res)\n\t\t// { status: 'OK' }\n\t})\n\t.catch(err =\u003e {\n\t\t// handle error\n\t})\n```\n\n## License\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjagannathbhat%2Fasync-storage-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjagannathbhat%2Fasync-storage-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjagannathbhat%2Fasync-storage-db/lists"}