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

@viloris/vela-plugin-fs

v0.0.1

Published

Host TS capability plugin: app-sandbox + OS-scoped filesystem

Readme

@viloris/vela-plugin-fs

First-party T1 capability plugin: filesystem access for Apps via vela.call("fs.*").

Two path domains share one method family:

| Domain | Paths | Permissions | |--------|-------|-------------| | app | App-relative under the sandbox (notes/a.txt) | fs:app-read, fs:app-write | | os | Absolute OS paths under manifest path scopes | fs:read, fs:write, fs:meta, fs:manage |

| Surface | Value | |---------|--------| | Methods | fs.read, fs.write, fs.exists, fs.stat, fs.readDir, fs.mkdir, fs.remove, fs.rename, fs.copy | | Reserved | fs.watch (permission + contract stub; needs event bus) | | Systems | HostAPI.sys.fs (injected; mock for tests) | | Encodings | utf8 (default), base64, bytes (number[] wire) |

Absolute / drive / UNC paths always route to the os domain. App-relative paths reject .. escape and absolute forms.

Host registration

import { createCapabilityHost } from "@viloris/vela-host-core";
import { BuiltinPermissions } from "@viloris/vela-api";
import { registerFsPlugin, createMockFsSys } from "@viloris/vela-plugin-fs";

const mock = createMockFsSys({ files: { "notes/a.txt": "hello" } });

const host = createCapabilityHost({
  api: {
    platform: "linux",
    sys: { fs: mock.facade },
  },
  capabilities: {
    default: {
      permissions: [
        BuiltinPermissions.FsAppRead,
        BuiltinPermissions.FsAppWrite,
        // OS domain (optional):
        // BuiltinPermissions.FsRead,
        // BuiltinPermissions.FsWrite,
        // BuiltinPermissions.FsMeta,
        // BuiltinPermissions.FsManage,
      ],
      // optional path scopes — resource is the normalized path
      scopes: [
        { type: "path", pattern: "notes/**" },
        // { type: "path", pattern: "/home/me/Projects/**" },
      ],
    },
  },
});
registerFsPlugin(host);

App (page)

const { data } = await window.vela.call("fs.read", { path: "notes/a.txt" });
await window.vela.call("fs.write", { path: "notes/b.txt", data: "world" });

// OS path (requires fs:read + path scope):
await window.vela.call("fs.read", { path: "/home/me/Projects/a.txt" });

// thin wrappers:
import {
  readAppFile,
  writeAppFile,
  readFile,
  writeFile,
  existsPath,
  statPath,
  readDir,
  mkdirPath,
  removePath,
  renamePath,
  copyPath,
} from "@viloris/vela-plugin-fs/client";

await writeAppFile("notes/b.txt", "world");
await mkdirPath("notes/sub", { recursive: true });

Real OS filesystem

Inject sys.fs from the privileged Host — never from App TS.

| Backend | Package | Notes | |---------|---------|--------| | Node / Bun runtime | @viloris/vela-sys-desktop createDesktopFsSys({ root }) | Default; good for CI | | Zig kernel | @viloris/vela-sys-desktop createVelaSysFs({ root }) | libs/vela-sys via Bun FFI (ADR 0008) |

import { createDesktopSystems, createVelaSysFs } from "@viloris/vela-sys-desktop";

// Convenience: node backend
const systems = createDesktopSystems({
  fs: { root: appDataDir }, // backend: "node" (default)
});

// Or Zig kernel (requires built libvela_sys)
const systemsZig = createDesktopSystems({
  fs: { root: appDataDir, backend: "vela-sys" },
});

// Or inject only the facade:
const fs = createVelaSysFs({ root: appDataDir });

Build the Zig library once:

cd libs/vela-sys && zig build && zig build test
# produces zig-out/lib/libvela_sys.so (or .dylib / .dll)
# override path: VELA_SYS_LIB=/path/to/libvela_sys.so

OS-domain calls re-check path scopes after optional realpath (symlink escape defense).

Pair with dialog:* when the user picks a path outside declared scopes — that is a separate grant path.

Verify

bun test plugins/fs
bun test packages/sys-desktop/src/fs
bun run --filter @viloris/vela-plugin-fs typecheck
cd libs/vela-sys && zig build test