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

@evopos/vite-plugin

v0.1.0

Published

Vite plugin for EvoPOS plugin developers: multi-page build, manifest.json checks, fake kassa at /__evopos/, sandbox dev mode

Readme

@evopos/vite-plugin

Vite plugin for EvoPOS plugin developers. It sets up a multi-page build for your slot pages, checks manifest.json while you type, serves a fake kassa at /__evopos/, and (optionally) registers your dev server in your EvoPOS sandbox so the real sandbox kassa opens your pages from localhost.

Install

npm install -D @evopos/vite-plugin vite

Requires Node 20+ and Vite 6 or newer.

Usage

// vite.config.ts
import { defineConfig } from 'vite';
import evopos from '@evopos/vite-plugin';

export default defineConfig({
    plugins: [evopos()],
});

The plugin returns an array of Vite plugins; evopos() can be placed in plugins as is. A named export evopos is available too.

What it does:

  • Sets base: './' (the plugin is served from a sandboxed iframe, so absolute asset paths would break).
  • Uses every *.html in the project root and every *.html under pages/ as a build input (unless you set build.rollupOptions.input / build.rolldownOptions.input yourself).
  • Enables dev-server CORS for the sandbox iframe, whose origin is null, plus localhost. It never uses origin: true. Private Network Access preflights are answered too.
  • Validates manifest.json against the EvoPOS contracts and checks that every slot entry is one of the build inputs. For drivers it checks that the entry file exists in public/.
    • Dev: errors show in the Vite overlay and in the terminal; the page reloads once the manifest is fixed. GET /manifest.json serves the manifest (HTTP 422 with { ok: false, errors } while it is invalid).
    • Build: the build fails with the list of errors; a valid manifest is emitted as manifest.json in the output.

Options

| Option | Type | Default | Description | |---|---|---|---| | manifest | string | 'manifest.json' | Path to the manifest, relative to the project root. | | pagesDir | string | 'pages' | Folder whose *.html files (recursively) are build inputs. | | devSession | boolean | true | Register the dev server in your sandbox (see below). | | devUrl | string | EVOPOS_DEV_URL, else http(s)://localhost:<port>/ | URL the sandbox kassa opens in the iframe. | | fakeKassa | boolean | true | Serve the fake kassa page at /__evopos/. | | api | string | EVOPOS_API_BASE, else production | Developer API base URL (same as --api in the CLI). |

createClient, now and env exist for tests only.

Fake kassa: /__evopos/

Open http://localhost:5173/__evopos/ while vite is running. The page loads your slot in a sandboxed iframe (sandbox="allow-scripts", so the same origin null as in the real kassa) and plays the host side of the protocol:

  • pick a slot, edit the context JSON and the granted permissions;
  • emit events, including receipt.before_close with a checked response;
  • see every call the plugin makes (ui.toast, ui.notify, ui.confirm, ui.open_modal, ...) in a log;
  • modals opened with ui.open_modal appear as windows with their own iframe;
  • manifest errors are shown on the page; drivers get a short note instead of a slot (they have no UI).

The page works fully offline and needs no account. The page is available only in the dev server and is not part of the build. Turn it off with evopos({ fakeKassa: false }).

Dev mode in the sandbox

When you run vite, the plugin can register your dev server in your EvoPOS sandbox, so you can see the plugin inside the real sandbox kassa:

  1. Log in once: npx evopos login (or set EVOPOS_TOKEN).
  2. Run vite. The plugin sends the manifest and your dev URL to the developer API (PUT). The terminal banner shows the sandbox it is connected to.
  3. A dev session lives 15 minutes. The plugin renews it (heartbeat, about every third of the TTL) and re-sends the manifest when you change it.
  4. On exit (Ctrl+C or server.close()) the plugin removes the session (DELETE).

Without a token, dev mode is skipped with a hint to run evopos login; nothing else is affected. A network failure is a warning and the plugin retries; a rejected token (401/403) stops the heartbeat. Turn dev mode off with evopos({ devSession: false }).

Other devices and https

The sandbox kassa opens your devUrl from the browser of whoever uses the kassa. http://localhost works on your own machine. To open it from another device (a phone, a second computer with a kassa) you need an address that device can reach, and over https if the kassa itself runs on https (browsers block mixed content):

# one-time: local CA and a certificate for your LAN name
brew install mkcert            # or see https://github.com/FiloSottile/mkcert
mkcert -install
mkcert localhost 192.168.1.20
// vite.config.ts
import fs from 'node:fs';
import { defineConfig } from 'vite';
import evopos from '@evopos/vite-plugin';

export default defineConfig({
    server: {
        host: true,
        https: {
            key: fs.readFileSync('./localhost+1-key.pem'),
            cert: fs.readFileSync('./localhost+1.pem'),
        },
    },
    plugins: [evopos({ devUrl: 'https://192.168.1.20:5173/' })],
});

The other device must trust the mkcert root CA (install rootCA.pem there). If you start the server with --host and without https, the plugin prints a warning. Instead of devUrl you can set EVOPOS_DEV_URL.

Environment variables

| Variable | Meaning | |---|---| | EVOPOS_TOKEN | Developer token (otherwise the one saved by evopos login). | | EVOPOS_DEV_URL | URL for the sandbox kassa to open (overridden by the devUrl option). | | EVOPOS_API_BASE | Developer API base URL (overridden by the api option). |

License

MIT