
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
Automatically use the right abstract-leveldown module for your configuration
npm install --save autolevel
For a full installation, supporting all types included in the code, run the following:
npm install --save autolevel levelup leveldown mongodown memdown sqldown mssql mysql mysql2 sqlite3 pg pg-query-stream
I was tired of looking for which combination of modules to install every time I started a new project for myself or work using leveldb. This is simply a documented wrapper for common abstract-leveldown adapters, passing options to the used abstract-leveldown module and returning a levelup instance.
Below you'll find which extra dependencies you'd need to connect to certain backends.
// Load autolevel
const autolevel = require('autolevel');
// Some variables we'll show
var db;
// Autodetect backend using environment variables
db = autolevel();
// Load database from folder, relative to the app root
db = autolevel('dir:data/');
// Load database from folder, absolute path
db = autolevel('dir://data/');
// Use mongodb storage
db = autolevel('mongodb://localhost:27017/database');
// Use authenticated mysql backend
db = autolevel('mysql://username:password@host:3306/database');
| type | schemes/protocols | driver | Dependencies |
|---|---|---|---|
| plain | dir, level, leveldb | leveldown | levelup, leveldown |
| mongodb | mongo, mongodb | mongodown | levelup, mongodown |
| in-memory | ram, mem, memory | memdown | levelup, memdown |
| mssql | mssql | sqldown | levelup, sqldown, mssql |
| mysql | mysql | sqldown | levelup, sqldown, mysql |
| mysql2 | mysql2 | sqldown | levelup, sqldown, mysql2 |
| sqlite3 | sqlite, sqlite3 | sqldown | levelup, sqldown, sqlite3 |
| postgres | pg, postgres, postgresql | sqldown | levelup, sqldown, pg, pg-query-stream |
FAQs
automatically connect levelup using database url
The npm package autolevel receives a total of 1 weekly downloads. As such, autolevel popularity was classified as not popular.
We found that autolevel 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.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.