New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

enmap

Package Overview
Dependencies
Maintainers
1
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enmap - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

0

.eslintrc.json
{
"extends": "airbnb-base"
}

2

package.json
{
"name": "enmap",
"version": "0.1.2",
"version": "0.2.0",
"description": "",

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

const level = require('native-level-promise');
const path = require('path');
const { inspect } = require('util');
const fs = require('fs');

@@ -37,11 +37,13 @@ /**

this.defer = new Promise(resolve => this.ready = resolve);
if (options.persistent) {
if (!options.name) throw new Error('Must provide a name for the Enmap.');
if (options.name) this.persistent = options.persistent || true;
if (this.persistent) {
if (!options.name) throw new Error('Must provide a name for a persistent Enmap.');
this.name = options.name;
//todo: check for "unique" option for the DB name and exit if exists
// todo: check for "unique" option for the DB name and exit if exists
this.validateName();
this.dataDir = (options.dataDir || 'data');
this.dataDir = path.resolve(process.cwd(), (options.dataDir || 'data'));
this.persistent = (options.persistent || false);
if (!options.dataDir) {
const fs = require('fs');
if (!fs.existsSync('./data')) {

@@ -51,3 +53,3 @@ fs.mkdirSync('./data');

}
this.path = path.join(process.cwd(), this.dataDir, this.name);
this.path = path.join(this.dataDir, this.name);
this.db = new level(this.path);

@@ -66,3 +68,3 @@ this.init();

const stream = this.db.keyStream();
stream.on('data', key => {
stream.on('data', (key) => {
this.db.get(key, (err, value) => {

@@ -568,2 +570,2 @@ if (err) console.log(err);

module.exports = Enmap;
module.exports = Enmap;

@@ -0,0 +0,0 @@ const PersistentCollection = require('../');

Sorry, the diff of this file is not supported yet

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