Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
enmap-mongo
Advanced tools
Enmap-Mongo is a provider for the Enmap module.
To install Enmap-Mongo simply run npm i enmap-mongo
.
// Load Enmap
const Enmap = require('enmap');
// Load EnmapMongo
const EnmapMongo = require('enmap-mongo');
// Initialize the provider
const Provider = new EnmapMongo({ name: 'test' });
// Initialize the Enmap with the provider instance.
const myColl = new Enmap({ provider: provider });
Shorthand declaration:
const Enmap = require('enmap');
const EnmapMongo = require('enmap-mongo');
const myColl = new Enmap({ provider: new EnmapMongo({ name: 'test' }); });
// Example with all options.
const level = new EnmapMongo({
name: 'test',
dbName: 'enmap',
user: 'username',
pass: 'password',
host: 'localhost',
port: 27017
});
// Example with full URL.
const level = new EnmapMongo({
name: 'test',
dbName: 'enmap',
url: 'mongodb://username:password@localhost:27017/enmap'
});
The name
option is mandatory and defines the name of the collection where the data is stored.
The dbName
is optional and defines the database where data is stored. If multiple enmap instances connect to the same database, the same database is used with different table collections. The default database is enmap
.
The host
is optional and defines which host this module attempts to connect to. The default host is localhost
.
The port
is optional and defines which port is used to connect to the Rethink DB. The default port is 27017
.
Optional, used for authentication. Needs both to work, or neither.
Optional. If used, the host
, port
, user
and pass
options are ignored , and url
is used instead. Note that the /dbname
at the end of your url must correspond to the dbName
value (or enmap
).
FAQs
A MongoDB provider for Enmap
The npm package enmap-mongo receives a total of 18 weekly downloads. As such, enmap-mongo popularity was classified as not popular.
We found that enmap-mongo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.