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

wchisp-web

v0.2.1

Published

Browser WebUSB/WebSerial TypeScript port of ch32-rs/wchisp for WCH ISP flashing.

Readme

wchisp-web

npm version

A browser-oriented TypeScript port of the core ch32-rs/wchisp flashing protocol. It supports WebUSB and Web Serial transports, chip identification, config reads/writes, unprotect, code flash erase/program/verify/reset, Intel HEX/BIN/ELF loading, and EEPROM/data flash read/write/erase helpers.

Published npm package: https://www.npmjs.com/package/wchisp-web

Install/build

Node.js 18+ is required. Then install dependencies and build the library:

npm install wchisp-web

For local development of this repository:

npm install
npm run build

This produces a dist/ folder built with Rolldown:

| File | Format | Purpose | |---|---|---| | dist/index.js | ESM | npm / bundler consumers | | dist/index.d.ts | — | TypeScript types | | dist/index.umd.min.js | UMD (minified) | <script> tag / CDN |

CDN / script tag usage

<script src="https://unpkg.com/wchisp-web/dist/index.umd.min.js"></script>
<script>
  const { WebUsbTransport, WchIspFlasher } = WchIsp;
</script>

Local test site

A minimal browser test app is included in test-site/ so you can quickly validate WebUSB/Web Serial flows against real hardware.

npm run serve

Then open http://localhost:8294 and:

  • Connect with WebUSB or Web Serial
  • Read config
  • Select a firmware file (.bin, .hex, .elf) and run flash

Note: Browser hardware APIs need localhost or HTTPS. You need to have interacted with the page first before you can request a device. If you are using WebUSB, you may need to install a WinUSB-compatible driver on Windows like Zadig.

WebUSB example

This is for most WCH chips that support USB ISP. It uses the WebUsbTransport and WchIspFlasher classes to connect to a device, read its info, and flash a firmware file.

import { WebUsbTransport, WchIspFlasher } from 'wchisp-web';

button.onclick = async () => {
  const transport = await WebUsbTransport.request();
  const isp = new WchIspFlasher(transport);
  const info = await isp.connect();
  console.log(info.name, [...info.uid]);

  const file = fileInput.files![0];
  await isp.flash(file, {
    unprotect: false,
    erase: true,
    verify: true,
    reset: true,
    progress: e => console.log(e.phase, e.done, '/', e.total),
  });
};

Web Serial example

Some WCH chips only support serial ISP. This example uses the WebSerialTransport and WchIspFlasher classes to connect to a device, read its info, and flash a firmware file.

import { WebSerialTransport, WchIspFlasher } from 'wchisp-web';

const transport = await WebSerialTransport.request({ baudRate: 115200 });
const isp = new WchIspFlasher(transport);
await isp.flash(new Uint8Array(await firmwareFile.arrayBuffer()));

Protocol coverage

Implemented command encoders:

  • IDENTIFY 0xa1
  • ISP_END 0xa2
  • ISP_KEY 0xa3
  • ERASE 0xa4
  • PROGRAM 0xa5
  • VERIFY 0xa6
  • READ_CONFIG 0xa7
  • WRITE_CONFIG 0xa8
  • DATA_ERASE 0xa9
  • DATA_PROGRAM 0xaa
  • DATA_READ 0xab
  • SET_BAUD 0xc5

Transport coverage:

  • WebUSB bulk endpoints matching upstream: OUT 0x02, IN 0x82
  • Web Serial framing: request prefix 57 ab, response prefix 55 aa, checksum byte