{"id":13620148,"url":"https://github.com/restuwahyu13/node-disk-storage","last_synced_at":"2025-05-07T04:41:18.577Z","repository":{"id":37965295,"uuid":"395723113","full_name":"restuwahyu13/node-disk-storage","owner":"restuwahyu13","description":"Fast and Secure local storage persistent data for Node JS","archived":false,"fork":false,"pushed_at":"2023-03-06T12:58:56.000Z","size":590,"stargazers_count":16,"open_issues_count":9,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T06:24:32.185Z","etag":null,"topics":["cache-storage","caching","data-store","disk-storage","keyvalue","keyvaluestore","local","local-storage","localstorage","module","node-module","nodejs","npm-package","persist","persistance","persistent-data","persistent-storage","session","session-storage"],"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/restuwahyu13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-08-13T16:36:11.000Z","updated_at":"2024-11-04T00:39:17.000Z","dependencies_parsed_at":"2024-01-06T14:51:54.912Z","dependency_job_id":null,"html_url":"https://github.com/restuwahyu13/node-disk-storage","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restuwahyu13%2Fnode-disk-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restuwahyu13%2Fnode-disk-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restuwahyu13%2Fnode-disk-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restuwahyu13%2Fnode-disk-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/restuwahyu13","download_url":"https://codeload.github.com/restuwahyu13/node-disk-storage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249626612,"owners_count":21302228,"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":["cache-storage","caching","data-store","disk-storage","keyvalue","keyvaluestore","local","local-storage","localstorage","module","node-module","nodejs","npm-package","persist","persistance","persistent-data","persistent-storage","session","session-storage"],"created_at":"2024-08-01T21:00:52.787Z","updated_at":"2025-04-19T15:32:30.563Z","avatar_url":"https://github.com/restuwahyu13.png","language":"TypeScript","funding_links":[],"categories":["N"],"sub_categories":[],"readme":"# Node Disk Storage (NDS)\n\n[![Build Status](https://scrutinizer-ci.com/g/restuwahyu13/node-disk-storage/badges/build.png?b=main)](https://scrutinizer-ci.com/g/restuwahyu13/node-disk-storage/build-status/main)\n[![Coverage Status](https://coveralls.io/repos/github/restuwahyu13/node-disk-storage/badge.svg?branch=main)](https://coveralls.io/github/restuwahyu13/node-disk-storage?branch=main)\n[![CodeFactor](https://www.codefactor.io/repository/github/restuwahyu13/node-disk-storage/badge)](https://www.codefactor.io/repository/github/restuwahyu13/node-disk-storage)\n[![codebeat badge](https://codebeat.co/badges/5611b53e-e00a-40c1-bab2-b9a8f5592b33)](https://codebeat.co/projects/github-com-restuwahyu13-node-disk-storage-main)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/d74af409b71641fb96484df3dc582365)](https://www.codacy.com/gh/restuwahyu13/node-disk-storage/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=restuwahyu13/node-disk-storage\u0026utm_campaign=Badge_Grade)![node-current](https://img.shields.io/node/v/node-disk-storage?style=flat-square)\n![npm](https://img.shields.io/npm/dm/node-disk-storage)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/restuwahyu13/node-disk-storage/blob/main/CONTRIBUTING.md)\n\n**node-disk-storage** a simple fast and secure `local storage` for `nodejs`, you can store any data using key and value, and then your data will be **encrypt**\nto be like this `�+�)data|ZGF0YXxqb2huK2RvZV5eXiQwfDFd^^^$0|1`.\n\n\u003cimg src=\"images/nds-work.png\" alt=\"example-nds-work\"/\u003e\n\n- [Node Disk Storage (NDS)](#node-disk-storage-nds)\n  - [Installation](#installation)\n  - [API Reference](#api-reference)\n  - [Example Usage](#example-usage)\n  - [Testing](#testing)\n  - [Bugs](#bugs)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n## Installation\n\n```bash\n$ npm install node-disk-storage -S or yarn add node-disk-storage -S\n```\n\n## API Reference\n\n- #### Node Disk Storage Options Property\n\n  - **minSize** limit data size, before saving into disk, default value to **1MB**\n  - **maxSize** limit data size, before saving into disk, default value to **25MB**\n\n- #### set(key: string, value: any): Promise\u003cboolean | undefined\u003e\n\n  set data using key and value, into disk\n\n- #### get(key: string): Promise\u003cany | undefined\u003e\n\n  get specific data using key, after saving data into disk\n\n- #### key(key: string): Promise\u003cboolean | undefined\u003e\n\n  get specific key, after saving data into disk\n\n- #### remove(key: string): Promise\u003cboolean | undefined\u003e\n\n  remove specific data already exist using key, after saving data into disk\n\n- #### clear(): Promise\u003cboolean | undefined\u003e\n\n  clear all keys exist, after saving data into disk\n\n- #### keys(): Promise\u003cstring[] | undefined\u003e\n  get all keys exist, after saving data into disk\n\n## Example Usage\n\n- ##### Example Usage Using CommonJs With JavaScript\n\n  ```javascript\n  const { NodeDiskStorage } = require('node-disk-storage')\n\n  const nds = new NodeDiskStorage()\n\n  ;(async () =\u003e {\n  \tawait nds.set('user', {\n  \t\tid: 1,\n  \t\tname: 'Leanne Graham',\n  \t\tusername: 'Bret',\n  \t\temail: 'Sincere@april.biz',\n  \t\taddress: {\n  \t\t\tstreet: 'Kulas Light',\n  \t\t\tsuite: 'Apt. 556',\n  \t\t\tcity: 'Gwenborough',\n  \t\t\tzipcode: '92998-3874',\n  \t\t\tgeo: { lat: '-37.3159', lng: '81.1496' }\n  \t\t},\n  \t\tphone: '1-770-736-8031 x56442',\n  \t\twebsite: 'hildegard.org',\n  \t\tcompany: {\n  \t\t\tname: 'Romaguera-Crona',\n  \t\t\tcatchPhrase: 'Multi-layered client-server neural-net',\n  \t\t\tbs: 'harness real-time e-markets'\n  \t\t}\n  \t})\n  \tawait nds.get('user')\n  \tawait nds.key('user')\n  \tawait nds.keys()\n  \tawait nds.remove('user')\n  \tawait nds.clear()\n  })()\n  ```\n\n- ##### Example Usage Using CommonJs With JavaScript And Options\n\n  ```javascript\n   const { NodeDiskStorage } = require('node-disk-storage')\n\n   const nds = new NodeDiskStorage({ minSize: 5, maxSize: 30 })\n\n   ;(async () =\u003e {\n     await nds.set(\"user\", {\n        id: 1,\n        name: 'Leanne Graham',\n        username: 'Bret',\n        email: 'Sincere@april.biz',\n        address: {\n          street: 'Kulas Light',\n          suite: 'Apt. 556',\n          city: 'Gwenborough',\n          zipcode: '92998-3874',\n          geo: { lat: '-37.3159', lng: '81.1496' }\n        },\n        phone: '1-770-736-8031 x56442',\n        website: 'hildegard.org',\n        company: {\n          name: 'Romaguera-Crona',\n          catchPhrase: 'Multi-layered client-server neural-net',\n          bs: 'harness real-time e-markets'\n        }\n      })\n     await nds.get(\"user\")\n     await nds.key('user')\n     await nds.keys()\n     await nds.remove(\"user\")\n     await nds.clear()\n  ```\n\n- ##### Example Usage Using ESM With JavaScript\n\n  ```javascript\n   import { NodeDiskStorage } from 'node-disk-storage'\n\n   const nds = new NodeDiskStorage()\n\n   ;(async () =\u003e {\n     await nds.set(\"user\", {\n        id: 1,\n        name: 'Leanne Graham',\n        username: 'Bret',\n        email: 'Sincere@april.biz',\n        address: {\n          street: 'Kulas Light',\n          suite: 'Apt. 556',\n          city: 'Gwenborough',\n          zipcode: '92998-3874',\n          geo: { lat: '-37.3159', lng: '81.1496' }\n        },\n        phone: '1-770-736-8031 x56442',\n        website: 'hildegard.org',\n        company: {\n          name: 'Romaguera-Crona',\n          catchPhrase: 'Multi-layered client-server neural-net',\n          bs: 'harness real-time e-markets'\n        }\n      })\n     await nds.get(\"user\")\n     await nds.key('user')\n     await nds.keys()\n     await nds.remove(\"user\")\n     await nds.clear()\n  ```\n\n- ##### Example Usage Using ESM With JavaScript And Options\n\n  ```javascript\n   import { NodeDiskStorage } from 'node-disk-storage'\n\n   const nds = new NodeDiskStorage({ minSize: 5, maxSize: 30 })\n\n   ;(async () =\u003e {\n     await nds.set(\"user\", {\n        id: 1,\n        name: 'Leanne Graham',\n        username: 'Bret',\n        email: 'Sincere@april.biz',\n        address: {\n          street: 'Kulas Light',\n          suite: 'Apt. 556',\n          city: 'Gwenborough',\n          zipcode: '92998-3874',\n          geo: { lat: '-37.3159', lng: '81.1496' }\n        },\n        phone: '1-770-736-8031 x56442',\n        website: 'hildegard.org',\n        company: {\n          name: 'Romaguera-Crona',\n          catchPhrase: 'Multi-layered client-server neural-net',\n          bs: 'harness real-time e-markets'\n        }\n      })\n     await nds.get(\"user\")\n     await nds.key('user')\n     await nds.keys()\n     await nds.remove(\"user\")\n     await nds.clear()\n  ```\n\n## Testing\n\n- Testing Via Local\n\n  ```sh\n  npm test or make test\n  ```\n\n- Testing Via Local And Build\n\n  ```sh\n  make build\n  ```\n\n- Testing Via Docker\n\n  ```sh\n  docker build -t node-disk-storage or make dkb tag=node-disk-storage\n  ```\n\n## Bugs\n\nFor information on bugs related to package libraries, please visit [here](https://github.com/restuwahyu13/node-disk-storage/issues)\n\n## Contributing\n\nWant to make **node-disk-storage** more perfect ? Let's contribute and follow the\n[contribution guide.](https://github.com/restuwahyu13/node-disk-storage/blob/main/CONTRIBUTING.md)\n\n## License\n\n- [MIT License](https://github.com/restuwahyu13/node-disk-storage/blob/main/LICENSE.md)\n\n\u003cp align=\"right\" style=\"padding: 5px; border-radius: 100%; background-color: red; font-size: 2rem;\"\u003e\n  \u003cb\u003e\u003ca href=\"#node-disk-storage-nds\"\u003eBACK TO TOP\u003c/a\u003e\u003c/b\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestuwahyu13%2Fnode-disk-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frestuwahyu13%2Fnode-disk-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestuwahyu13%2Fnode-disk-storage/lists"}