Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A more practcal alternative to localStorage. db64 supports all major browsers.
import db64 from './db64.js'
db64.use('animals') // - Create or use an existing database
.store('birds') // - create or use an existubg store
.setEntries({warbler: 4, cuckoo: 3, emu: 2}) // - Set multiple entries via an array or object
db64.store('birds').getEntries(['emu', 'warbler']) // Get multiple entries
db64.store('birds').delete(['cuckoo', 'emu']) // Delete a single or array of entries
db64.clear('birds') // Delete all entries in birds
Install db64
npm i db64
Create or use an existing database [string] (the default DB name is "default")
db64.use('localDB') // Returns db64
Create a store and set data. See structured clone algorithm for supported types.
db64.store('fruits').set('some-key', 'some-value') // [Promise]
Get data [string]
const someKey = await db64.store('fruits').get('some-key') // [Promise]
Set multiple entries [Object] | [Array]
db64.store('fruits').setEntries({ bananas: 5, pears: 4, mangoes: 7, apples: 2 }) // [Promise]
// or
db64.store('fruits').setEntries([ 'bananas', 'pears', 'mangoes', 'apples' ]) // [Promise]
Get multiple entries [Array]
const rosaceaeFruits = await db64.store('fruits').setEntries([ 'pears', 'apples' ]) // [Promise]
Delete a single or multiple entries [String] | [Array]
db64.store('fruits').delete('mangoes') // [Promise]
// or
db64.store('fruits').delete([ 'bananas', 'mangoes' ]) // [Promise]
Empty an object store [String]
db64.clear('fruits') // [Promise]
Deleting existing versions of databases or object stores in IndexedDB is not feasible due to the requirement to create a new version, and old versions remain accessible. While compaction may optimize, it doesn't ensure the removal of unwanted data. db64 provides an effective solution by allowing you to clear an object store, removing all its data. This feature proves beneficial for any application, even in cases where empty stores cannot be removed. If you do require versioning consider using idb. If you're not building a progressive web app (PWA) you probably don't need versioning.
Don't hesitate just contribute, it's a tiny library we will figure it out.
MIT (c) Julien Etienne 2023
FAQs
A Practical IndexedDB API
The npm package db64 receives a total of 50 weekly downloads. As such, db64 popularity was classified as not popular.
We found that db64 demonstrated a healthy version release cadence and project activity because the last version was released less than 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.