npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nostr-key-value

v1.0.1

Published

NOTE: This README is translated by DeepL.

Readme

Nostr-Key-Value

NOTE: This README is translated by DeepL.

This is a project that wants to use Nostr as a Key-Value DB. JavaScript/TypeScript support.

->日本語のREADMEはこちら (to Japanese)

This library uses NIP-78, which is a system that provides something like remoteStorage. NIP-78 is a system that provides something like remoteStorage; it is a post with Kind: 30078 and extends NIP-33 (Kind: 3xxxx).

-> NIP-78

※ v0.3.x docs -> ./docs/v0.3/README.md

Who made it

Shino3 (Shino-san) from:🇯🇵

License

MIT applies to this library.

Data configuration

This project is intended to be used to create KeyValue storage as follows.
The content of the value can be anything, but it must be a string. For example, you can set up a JSON-format object, but it must be encoded as a string.

  • Author:
    • Table 1
      • Key: value
      • Key: value
      • Key: value
    • Table 2
      • Key: value
      • Key: value
      • Key: value
    • Table 3
      • Key: value
      • Key: value
      • Key: value

Installation

You can install it with the following command:

npm install nostr-key-value

How to use

After installing via npm in your project, use the following code. Using initialize class.

const npub = process.env.NPUB_HEX ?? "";
const relays = ["wss://nos.lol"];
const nostrKeyValue: NostrKeyValue = new NostrKeyValue(
  relays,
  npub,
  "nostr_key_value_update_test",
);

await nostrKeyValue.setItem("item", "Hello!");
const result_1 = await nostrKeyValue.getItem("item");
console.log("getValue: ", result_1);
// > Hello!
await nostrKeyValue.dropItem("item", );
const result_2 = await nostrKeyValue.getItem("item");
console.log("getValue: ", result_2);
// > null

getItem

Searches a table from kind: 30078 which Author has, and gets the specified key of the table.

  • Arguments
    • key: string type (required)
  • Return value
    • string type or Null
    • If no match is found, the response will be null.

setItem

This function returns the JSON required to create a new table.
The table creation is complete when the JSON is signed and submitted to the relay.

Please use nostr-tools or other tools to sign and submit the JSON. This library does not support it. Note: If an identical table already exists on the relay, it will be overwritten.

  • Arguments
    • key: string (required)
    • value: string | number | null (required)
  • Return values
    • JSON object

example: ./tests/index.test.ts see in create or update section.

dropItem

This function deletes the specified key in the table.

Please use nostr-tools or other tools to sign and send JSON; this is not supported by this library. note Please note that rollback is not available.

  • Arguments
    • key: string (required)
  • Return value
    • JSON object or null
    • If there is no matching table, the response will be null.

example: ./tests/index.test.ts in drop section.