Gathering detailed insights and metrics for level-js
Gathering detailed insights and metrics for level-js
Gathering detailed insights and metrics for level-js
Gathering detailed insights and metrics for level-js
get-intrinsic
Get and robustly cache all JS language-level intrinsics at first require time
pm2-axon
High-level messaging & socket patterns implemented in pure js
@types/level-js
TypeScript definitions for level-js
wicked-good-xpath
Pure JS implementation of the DOM Level 3 XPath specification
Superseded by browser-level. An abstract-leveldown compliant store on top of IndexedDB.
npm install level-js
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
544 Stars
306 Commits
44 Forks
15 Watchers
2 Branches
23 Contributors
Updated on Jun 13, 2025
Latest Version
6.1.0
Package Id
level-js@6.1.0
Size
17.06 kB
NPM Version
7.21.1
Node Version
16.9.1
Published on
Sep 28, 2021
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
An
abstract-leveldown
compliant store on top of IndexedDB.
Here are the goals of level-js
:
abstract-leveldown
test suiteBuffer
keys and valuesBeing abstract-leveldown
compliant means you can use many of the Level modules on top of this library.
If you are upgrading: please see UPGRADING.md.
1const levelup = require('levelup') 2const leveljs = require('level-js') 3const db = levelup(leveljs('bigdata')) 4 5db.put('hello', Buffer.from('world'), function (err) { 6 if (err) throw err 7 8 db.get('hello', function (err, value) { 9 if (err) throw err 10 11 console.log(value.toString()) // 'world' 12 }) 13})
With async/await
:
1const levelup = require('levelup') 2const leveljs = require('level-js') 3const db = levelup(leveljs('bigdata')) 4 5await db.put('hello', Buffer.from('world')) 6const value = await db.get('hello')
Keys and values can be a string or Buffer
. Any other type will be irreversibly stringified. The only exceptions are null
and undefined
. Keys and values of that type are rejected.
In order to sort string and Buffer keys the same way, for compatibility with leveldown
and the larger ecosystem, level-js
internally converts keys and values to binary before passing them to IndexedDB.
If you desire non-destructive encoding (e.g. to store and retrieve numbers as-is), wrap level-js
with encoding-down
. Alternatively install level
which conveniently bundles levelup
, level-js
and encoding-down
. Such an approach is also recommended if you want to achieve universal (isomorphic) behavior. For example, you could have leveldown
in a backend and level-js
in the frontend. The level
package does exactly that.
When getting or iterating keys and values, regardless of the type with which they were stored, keys and values will return as a Buffer unless the asBuffer
, keyAsBuffer
or valueAsBuffer
options are set, in which case strings are returned. Setting these options is not needed when level-js
is wrapped with encoding-down
, which determines the optimal return type by the chosen encoding.
1db.get('key', { asBuffer: false }) 2db.iterator({ keyAsBuffer: false, valueAsBuffer: false })
With npm do:
1npm install level-js
Not to be confused with leveljs.
This library is best used with browserify.
db = leveljs(location[, options])
Returns a new leveljs
instance. location
is the string name of the IDBDatabase
to be opened, as well as the object store within that database. The database name will be prefixed with options.prefix
.
options
The optional options
argument may contain:
prefix
(string, default: 'level-js-'
): Prefix for IDBDatabase
name.version
(string | number, default: 1
): The version to open the database with.See IDBFactory#open
for more details.
Cross-browser Testing Platform and Open Source ♥ Provided by Sauce Labs.
Level/level-js
is an OPEN Open Source Project. This means that:
Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
See the Contribution Guide for more details.
Support us with a monthly donation on Open Collective and help us continue our work.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 2/24 approved changesets -- score normalized to 0
Reason
project is archived
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More