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
An abstract-leveldown compliant store on top of IndexedDB.
npm install level-js
98.3
Supply Chain
100
Quality
79.6
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
544 Stars
305 Commits
44 Forks
16 Watching
3 Branches
23 Contributors
Updated on 03 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
34.2%
169,934
Compared to previous day
Last week
11.1%
782,465
Compared to previous week
Last month
11.5%
2,954,272
Compared to previous month
Last year
51.3%
19,090,144
Compared to previous year
An abstract-leveldown
compliant store on top of IndexedDB.
:pushpin: This module will soon be deprecated, because it is superseded by
browser-level
.
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
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
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 2024-11-25
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@types/level-js
TypeScript definitions for level-js
lodash-next
An extension of lodash for next level js.
level-test
Inject temporary and isolated level stores (leveldown, level-js, memdown or custom) into your tests.
@ircam/como
high-level JS framework dedicated at creating movement based applications