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

@dignetwork/vite-plugin-dig

v0.1.0

Published

A Vite plugin that makes DIG a first-class deploy target: injects a window.chia dev shim during `vite dev`, wires the build output to a DIG capsule via dig.toml, and ships it on publish with `digstore deploy`. Deploy to a network no host can read, change,

Downloads

177

Readme

@dignetwork/vite-plugin-dig

A Vite plugin that makes DIG a first-class deploy target. Build with Vite, deploy to a DIG capsule — a network no host can read, change, or take down — on Chia.

It does two things:

  1. Dev wallet, for free. During vite dev it injects the @dignetwork/dig-sdk window.chia dev shim — the same injected-provider contract the SDK's ChiaProvider detects in production — so you can develop the wallet path without the DIG Browser or an extension. The shim guards on a real wallet (the DIG Browser always wins) and never fakes a signature.
  2. Publish to a capsule. digDeploy() ships your built site to a DIG capsule via digstore deploy, printing the chia:// / DIGHUb URL. Publishing spends $DIG, so it is a deliberate publish step — never part of vite build.
npm i -D @dignetwork/vite-plugin-dig

Quickstart

1. Add the plugin to vite.config.ts:

import { defineConfig } from "vite";
import { digVite } from "@dignetwork/vite-plugin-dig";

export default defineConfig({
  plugins: [digVite()], // injects the window.chia dev wallet during `vite dev`
});

Run vite dev and your app now has a window.chia to develop against. The SDK's ChiaProvider (mode: "injected") connects to it just like it would the real DIG Browser wallet — except it returns a clearly-fake mock address and refuses to sign, so you always know it's the dev stub.

2. Add your store config to dig.toml (run digstore new to scaffold one, or write it by hand):

store-id      = "<your 64-hex store id>"
output-dir    = "dist"          # Vite's default build dir
message       = "deploy from vite"

3. Add a publish script that builds, then deploys:

// package.json
{
  "scripts": {
    "deploy": "vite build && node -e \"import('@dignetwork/vite-plugin-dig').then(m=>m.digDeploy())\""
  }
}
# Secrets come from env, never the command line:
export DIGSTORE_DEPLOY_KEY=<from `digstore deploy-key export`>
# (private store only) export DIGSTORE_STORE_SALT=<hex>
npm run deploy

digDeploy() reads dig.toml + DIGSTORE_* env, then runs digstore deploy --json to advance the on-chain root, stage dist/, and push the new capsule. It returns:

{
  capsule: "<storeId>:<rootHash>",                  // the capsule identity you can share
  storeId: "<storeId>",
  root:    "<rootHash>",
  chiaUrl: "chia://<storeId>:<rootHash>/",          // what a user clicks to open your verified app
  digUrl:  "chia://<storeId>:<rootHash>/",          // @deprecated alias of chiaUrl (same value)
  hubUrl:  "https://hub.dig.net/stores/<storeId>",  // the DIGHUb "view it" page
}

Prereq: digstore must be installed and on PATH (the canonical deployer — the plugin never hand-rolls a deploy or a spend). See the install docs.

API

digVite(options?): Plugin

The Vite plugin. Add to plugins. Options:

| Option | Type | Default | Meaning | |---|---|---|---| | devWallet | boolean | true | Inject the window.chia dev shim during vite dev. | | devWalletOptions.address | string | a clearly-fake dev address | The mock receive address the shim returns from getAddress. |

The shim is only injected on the dev server (apply: "serve") — never into a production build.

digDeploy(options?, deps?): Promise<DeployResult>

Deploy the built site. Call from a publish script after vite build. options are the digstore deploy knobs: storeId, outputDir (default dist), message, network, remote, waitTimeout, plus cwd and digstoreBin. Config precedence is options > DIGSTORE_* env > dig.toml > default. On failure it throws a coded DigAdapterError.

version() / capabilities()

import { version, capabilities } from "@dignetwork/vite-plugin-dig";
version();        // "0.1.0"
capabilities();   // { name, version, framework: "vite", features: [...], errorCodes: [...], docs }

Error codes

The publish path always throws a DigAdapterError with a stable .code — branch on the code:

| Code | When | |---|---| | DIGSTORE_NOT_FOUND | digstore is not installed / not on PATH. | | DEPLOY_FAILED | digstore deploy exited non-zero (the on-chain advance / push failed). | | DEPLOY_OUTPUT_UNPARSEABLE | digstore deploy --json output couldn't be parsed into a capsule. | | INVALID_ARGUMENT | A malformed argument (e.g. a non-hex store id). |

import { digDeploy, isDigAdapterError } from "@dignetwork/vite-plugin-dig";
try {
  await digDeploy();
} catch (e) {
  if (isDigAdapterError(e, "DIGSTORE_NOT_FOUND")) console.error("Install digstore first.");
  else throw e;
}

The full catalogue is exported as DIG_ADAPTER_ERROR_CODES.

License

MIT.