
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
Keyva is a feather-weight zero-dependency TypeScript library that gives you key/value access to IndexedDB. It's as easy to use as localStorage, but still manages to expose a lot of the power of IndexedDB, such as complex object storage, binary data storage, indexes, and querying.
There are many existing IndexedDB abstractions. While these projects meet some definition of functional, a library design aficionado like myself finds them insufficiently elegant. This matters. Especially for a key/value access layer which is going to be used in literally every app one might build.
Some libraries have that it factor where a significant amount of thought was obviously given to the interface, rather than only the internals. These libraries place a very high value on ergonomics, simplicity, naming, cognitive load minimization, and achieving the best possible Intellisense experience. These libraries have staying power. They're the type you keep reaching for year after year.
I didn't find any key/value access layer that inspired this level of confidence. So I designed one that does.
Installation via npm:
npm install keyvajs --save
Script tag installation:
<script src="https://cdn.jsdelivr.net/npm/keyvajs/keyva.min.js"></script>
Or just download the Keyva.ts file and add it directly to your project.
Start by creating a Keyva object, which creates a new IndexedDB database with a default name:
const kv = new Keyva();
The Keyva class only has 4 methods: .get(), .set(), .delete(), and .each(). These methods have a few overloads, but otherwise, this is essentially the entire library.
// Writing
await kv.set("some-key", "some-value");
// Reading
const value = await kv.get("some-key");
// Deleting
await kv.delete("some-key");
// Iteration
for (const [key, value] of await kv.each()
{
// Do stuff
}
Get all keys and values from a Keyva:
const all = await kv.get();
Get multiple values at once:
const all = await kv.get(["key1", "key2"]);
Set multiple values at once:
await kv.set([["k0", "v0"], ["k1", "v1"], ["k2", "v2"]]);
For more complete usage examples, see the tests file
Do you need a world class player who can architect complex projects, design & implement beautiful UIs, write production-grade compilers, manage engineering teams, and speak the language of business? I'm available for hourly consulting work. (See my profile for contact info).
FAQs
Unknown package
We found that keyvajs 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
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.