Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

key-file-storage

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

key-file-storage - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

2

package.json
{
"name": "key-file-storage",
"version": "2.0.1",
"version": "2.0.2",
"description": "Simple key-value storage directly on file system, maps each key to a separate file.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -10,4 +10,4 @@ # key-file-storage

+ Very easy to learn and use
+ Both *Synchronous* and *Asynchronous* API
+ One JSON containing file per each key
+ Both *Synchronous* and *Asynchronous* APIs
+ One *JSON* containing file per each key
+ Built-in configurable cache

@@ -32,8 +32,8 @@ + Both *Promise* and *Callback* support

// Using an unlimited cache
var kfs = keyFileStorage('/path/to/storage/directory');
var kfs = keyFileStorage('/path/to/the/storage/directory');
// or
/* or */
// Using a custom cache
var kfs = keyFileStorage('/path/to/storage/directory', cacheConfig);
var kfs = keyFileStorage('/path/to/the/storage/directory', cacheConfig);
```

@@ -55,9 +55,9 @@

// Set
kfs['key'] = value;
kfs['key'] = value
// Get
kfs['key'];
kfs['key']
// Delete
delete kfs['key'];
delete kfs['key']

@@ -68,3 +68,3 @@ // Check for existence

// Clear all database
delete kfs['*'];
delete kfs['*']
```

@@ -84,9 +84,9 @@

// Set
kfs('key', value);
kfs('key', value)
// Get
kfs('key');
kfs('key')
// Delete
new kfs('key');
new kfs('key')

@@ -97,3 +97,3 @@ // Check for existence

// Clear all database
new kfs('*'); /* or */ new kfs();
new kfs('*') /* or */ new kfs()
```

@@ -109,9 +109,9 @@

// Set
kfs('key', value, callback);
kfs('key', value, callback)
// Get
kfs('key', callback);
kfs('key', callback)
// Delete
new kfs('key', callback);
new kfs('key', callback)

@@ -124,3 +124,3 @@ // Check for existence

// Clear all database
new kfs('*', callback); /* or */ new kfs(callback);
new kfs('*', callback) /* or */ new kfs(callback)
```

@@ -134,3 +134,3 @@

- **NOTE 1 :** Each key will map to a separate file (*using the key itself as its relative path*) so there is no need to load all the database file for any key access. Also, keys can be relative paths, e.g: `data.json`, `/my/key/01` or `any/other/relative/path/to/a/file`.
- **NOTE 1 :** Each key will map to a separate file (*using the key itself as its relative path*) so there is no need to load all the database file for any key access. Therefore, keys may be relative paths, e.g: `data.json`, `/my/key/01` or `any/other/relative/path/to/a/file`.

@@ -142,5 +142,5 @@ - **NOTE 2 :** There is a built-in implemented **cache**, so accessing a certain key more than once won't require file-system level operations (off course with some active cache).

The code is very simple and straightforward. It would be nice if you had any suggestions or contribution on it or detected any bug or issue.
The code is simple and straightforward. It would be nice if you had any suggestions or contribution on it or detected any bug or issue.
+ See the code on [GitHub.com](https://github.com/ahs502/key-file-storage)
+ Contact me by [my gmail address](ahs502@gmail.com) *(Hessam A Shokravi)*
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc