Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
bkv is browser persistent key/value storage with simple interface. It supports actual IndexedDB / localStorage. With silent fallback to memory store for error-less work (optional).
Install
npm install bkv --save
const bkv = new window.BKV()
await bkv.set('dolorem', { lorem: 'ipsum' })
const data = await bkv.get('dolorem')
console.log(`Loaded: ${data}`)
await bkv.remove('dolorem'));
Note, all methods with optional callbacks will return promises if callback is not set.
Options:
prefix
- Data namespace. Default - bkv
. Used to separate data for
multiple instances, if required.stores
- Array of storage names to use, ordered by preference.
Default ['indexeddb', 'localstorage', 'zero']
. Set to ['indexeddb', 'localstorage']
if no fallback to memory required.* zero
is simple memory store for silent fallback when no persistent storages available.
Load data by key
name. If not exists - returns default
(if passed) or undefined
.
Load all data from storage as [ { key, value }, { key, value }, ... ]
.
Put data into storage under key
name.
key
- String to address data.data
- serializable JS object to store.ttl
- Expiration time in seconds. Default = 0 (don't expire).Remove key
data from store. If Array
passed - remove all listed keys.
Clear all storage data (in your namespace), or just expired objects when called
with true
param.
Auto-executed on first call of any method. Usually not needed. But may be used, if you need exact info about availability of persistent storage, prior to start.
Alias of new BKV(options)
Similar to .create()
but returns the same (cached) instance for the same
options. Useful if you need BKV in multiple modules, and don't wish to
initialize it every time.
FAQs
Browser key/value storage with simple interface
The npm package bkv receives a total of 2 weekly downloads. As such, bkv popularity was classified as not popular.
We found that bkv 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.