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.1.4 to 2.1.5

2

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

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

@@ -179,16 +179,13 @@ # key-file-storage

// Locate 'db' folder in current directory as the storage path,
// Locate 'db' folder in the current directory as the storage path,
// Require 100 latest accessed key-values to be cached:
var kfs = keyFileStorage('./db', 100);
// Create file './db/users/hessam' containing this user data synchronously:
// Create file './db/users/hessam' containing this user data, synchronously:
kfs['users/hessam'] = {
name: "Hessam",
skills: {
java: 10,
csharp: 15
}
skills: { java: 10, csharp: 15 }
};
// Read file './db/users/hessam/skills' as a JSON object asynchronously:
// Read file './db/users/hessam' as a JSON object, asynchronously:
kfs('users/hessam').then(function(hessamData) {

@@ -199,3 +196,3 @@ console.log("Hessam's java skill is ",

// Check whether file './db/users/mahdiar' exists or not asynchronously:
// Check whether file './db/users/mahdiar' exists or not, asynchronously:
'users/mahdiar' in kfs(function(error, exists) {

@@ -207,3 +204,3 @@ if(exists) {

// List the file names of all users in './db/users/' synchronously:
// List all the keys in './db/users/', synchronously:
var allUsers = kfs['users/'];

@@ -210,0 +207,0 @@ //=> ['users/hessam', 'users/mahdiar', ... ]

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