Fast and Secure local storage persistent data for Node JS
Installations
npm install node-disk-storage
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
>=12
Node Version
16.15.0
NPM Version
8.5.5
Score
64.1
Supply Chain
95.3
Quality
75.1
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (90.91%)
Makefile (5.77%)
Dockerfile (3.32%)
Developer
restuwahyu13
Download Statistics
Total Downloads
20,414
Last Day
15
Last Week
111
Last Month
556
Last Year
10,708
GitHub Statistics
16 Stars
143 Commits
2 Forks
1 Watching
10 Branches
1 Contributors
Bundle Size
60.73 kB
Minified
15.11 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.0.6
Package Id
node-disk-storage@0.0.6
Unpacked Size
30.22 kB
Size
6.67 kB
File Count
17
NPM Version
8.5.5
Node Version
16.15.0
Total Downloads
Cumulative downloads
Total Downloads
20,414
Last day
-48.3%
15
Compared to previous day
Last week
-18.4%
111
Compared to previous week
Last month
2.6%
556
Compared to previous month
Last year
47.5%
10,708
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
3
Dev Dependencies
20
Node Disk Storage (NDS)
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
to be like this �+�)data|ZGF0YXxqb2huK2RvZV5eXiQwfDFd^^^$0|1
.
Installation
1$ npm install node-disk-storage -S or yarn add node-disk-storage -S
API Reference
-
Node Disk Storage Options Property
- minSize limit data size, before saving into disk, default value to 1MB
- maxSize limit data size, before saving into disk, default value to 25MB
-
set(key: string, value: any): Promise<boolean | undefined>
set data using key and value, into disk
-
get(key: string): Promise<any | undefined>
get specific data using key, after saving data into disk
-
key(key: string): Promise<boolean | undefined>
get specific key, after saving data into disk
-
remove(key: string): Promise<boolean | undefined>
remove specific data already exist using key, after saving data into disk
-
clear(): Promise<boolean | undefined>
clear all keys exist, after saving data into disk
-
keys(): Promise<string[] | undefined>
get all keys exist, after saving data into disk
Example Usage
-
Example Usage Using CommonJs With JavaScript
1const { NodeDiskStorage } = require('node-disk-storage') 2 3const nds = new NodeDiskStorage() 4 5;(async () => { 6 await nds.set('user', { 7 id: 1, 8 name: 'Leanne Graham', 9 username: 'Bret', 10 email: 'Sincere@april.biz', 11 address: { 12 street: 'Kulas Light', 13 suite: 'Apt. 556', 14 city: 'Gwenborough', 15 zipcode: '92998-3874', 16 geo: { lat: '-37.3159', lng: '81.1496' } 17 }, 18 phone: '1-770-736-8031 x56442', 19 website: 'hildegard.org', 20 company: { 21 name: 'Romaguera-Crona', 22 catchPhrase: 'Multi-layered client-server neural-net', 23 bs: 'harness real-time e-markets' 24 } 25 }) 26 await nds.get('user') 27 await nds.key('user') 28 await nds.keys() 29 await nds.remove('user') 30 await nds.clear() 31})()
-
Example Usage Using CommonJs With JavaScript And Options
1 const { NodeDiskStorage } = require('node-disk-storage') 2 3 const nds = new NodeDiskStorage({ minSize: 5, maxSize: 30 }) 4 5 ;(async () => { 6 await nds.set("user", { 7 id: 1, 8 name: 'Leanne Graham', 9 username: 'Bret', 10 email: 'Sincere@april.biz', 11 address: { 12 street: 'Kulas Light', 13 suite: 'Apt. 556', 14 city: 'Gwenborough', 15 zipcode: '92998-3874', 16 geo: { lat: '-37.3159', lng: '81.1496' } 17 }, 18 phone: '1-770-736-8031 x56442', 19 website: 'hildegard.org', 20 company: { 21 name: 'Romaguera-Crona', 22 catchPhrase: 'Multi-layered client-server neural-net', 23 bs: 'harness real-time e-markets' 24 } 25 }) 26 await nds.get("user") 27 await nds.key('user') 28 await nds.keys() 29 await nds.remove("user") 30 await nds.clear()
-
Example Usage Using ESM With JavaScript
1 import { NodeDiskStorage } from 'node-disk-storage' 2 3 const nds = new NodeDiskStorage() 4 5 ;(async () => { 6 await nds.set("user", { 7 id: 1, 8 name: 'Leanne Graham', 9 username: 'Bret', 10 email: 'Sincere@april.biz', 11 address: { 12 street: 'Kulas Light', 13 suite: 'Apt. 556', 14 city: 'Gwenborough', 15 zipcode: '92998-3874', 16 geo: { lat: '-37.3159', lng: '81.1496' } 17 }, 18 phone: '1-770-736-8031 x56442', 19 website: 'hildegard.org', 20 company: { 21 name: 'Romaguera-Crona', 22 catchPhrase: 'Multi-layered client-server neural-net', 23 bs: 'harness real-time e-markets' 24 } 25 }) 26 await nds.get("user") 27 await nds.key('user') 28 await nds.keys() 29 await nds.remove("user") 30 await nds.clear()
-
Example Usage Using ESM With JavaScript And Options
1 import { NodeDiskStorage } from 'node-disk-storage' 2 3 const nds = new NodeDiskStorage({ minSize: 5, maxSize: 30 }) 4 5 ;(async () => { 6 await nds.set("user", { 7 id: 1, 8 name: 'Leanne Graham', 9 username: 'Bret', 10 email: 'Sincere@april.biz', 11 address: { 12 street: 'Kulas Light', 13 suite: 'Apt. 556', 14 city: 'Gwenborough', 15 zipcode: '92998-3874', 16 geo: { lat: '-37.3159', lng: '81.1496' } 17 }, 18 phone: '1-770-736-8031 x56442', 19 website: 'hildegard.org', 20 company: { 21 name: 'Romaguera-Crona', 22 catchPhrase: 'Multi-layered client-server neural-net', 23 bs: 'harness real-time e-markets' 24 } 25 }) 26 await nds.get("user") 27 await nds.key('user') 28 await nds.keys() 29 await nds.remove("user") 30 await nds.clear()
Testing
-
Testing Via Local
1npm test or make test
-
Testing Via Local And Build
1make build
-
Testing Via Docker
1docker build -t node-disk-storage or make dkb tag=node-disk-storage
Bugs
For information on bugs related to package libraries, please visit here
Contributing
Want to make node-disk-storage more perfect ? Let's contribute and follow the contribution guide.
License
No vulnerabilities found.
No security vulnerabilities found.
Other packages similar to node-disk-storage
cache-manager-fs-hash
file system store for node cache manager
@hono-storage/node-disk
node-image-storage
Modules for CRUD operation with images
diskio-core
A disk I/O management utility to reserve, allocate, and optimize disk space usage, trying to ensure efficient file handling. Seamlessly locks disk space in advance, freeing and reallocating it for future I/O operations with optimal pagination for maximum