Visulima

Open source toolkit

The boring parts of shipping a TypeScript library, already solved.

Here is one library going from source to release in four steps, using four of the packages. Each installs on its own and none of them need the others.

View the source
Step 1 of 4

Build it without a config file.

Packem reads the entry points out of the exports you already declared, so there is no second list of files to keep in step with package.json.

@visulima/packem6k / weekpnpm add -D @visulima/packem
package.json
// package.json
{
  "exports": {
    "import": "./dist/index.mjs",
    "require": "./dist/index.cjs"
  },
  "types": "./dist/index.d.ts"
}

$ packem build
// CJS and ESM, .d.ts bundled, dependencies
// externalised. No config file required.

Next, see what it does at runtime

Step 2 of 4

Watch what it does.

Readable badges while you work, structured JSON in production, and the same logger in Node, at the edge and in the browser. Repeated lines get collapsed instead of flooding the output.

@visulima/pail6k / weekpnpm add @visulima/pail
logger.ts
import { pail } from "@visulima/pail";

pail.success("Operation successful");
pail.pending("Write release notes for %s", "1.2.0");
pail.fatal(new Error("Unable to acquire lock"));

// Or configure your own instance
import { createPail } from "@visulima/pail";

const logger = createPail({ logLevel: "warn" });

logger.info("Filtered out");
logger.force.info("Logged anyway");

Next, give it a command line

Step 3 of 4

Give it a command line.

Commands, flags and arguments, with the help output generated from the same definition, so the documentation cannot drift from the parser. Runs on Node, Deno and Bun.

@visulima/cerebro6k / weekpnpm add @visulima/cerebro
cli.ts
import { Cerebro } from "@visulima/cerebro";

const cli = new Cerebro("my-cli");

cli.addCommand({
  name: "build",
  description: "Build the project",
  options: [
    {
      name: "output",
      alias: "o",
      type: String,
      defaultValue: "dist",
    },
    { name: "watch", alias: "w", type: Boolean },
  ],
  execute: ({ logger, options }) => {
    logger.info(`Building to ${options.output}`);
  },
});

await cli.run();

Last, keep the repository honest

Step 4 of 4

Keep the repository honest.

One toolkit for the chores: a task runner with a cache, staged-file hooks, secret scanning, and a pinned installer so a fresh clone resolves the same tree. This site is built with it.

@visulima/vis4k / weekpnpm add -D @visulima/vis
vis.config.ts
// vis.config.ts
import { defineConfig } from "@visulima/vis/config";

export default defineConfig({
  install: { backend: "aube" },
  staged: {
    "*.{ts,tsx}": ["eslint --fix", "prettier --write"],
    "package.json": (files) =>
      `sort-package-json ${files.join(" ")}`,
  },
});
60+
Packages published on npm
500k+
Downloads per week
MIT
Licensed, every package

Most installed

The four above are the walkthrough. These are the ones that quietly turn up in the most lockfiles.

@visulima/boxenBoxes in the terminal159k
@visulima/vite-overlayReadable Vite errors32k
@visulima/errorStack traces worth reading31k
@visulima/fsFilesystem helpers29k
@visulima/tabularTables in the terminal25k
@visulima/pathCross-platform paths25k

What is in there

One monorepo, released package by package. Take the two you need and leave the rest.

13Terminal
10Data manipulation
8Error and debugging
8Tooling
5Email
3Filesystem
3API
2Storage
1Workflow
1Notification

Tested on the runtimes you ship to.

Every package targets modern Node and is verified against the alternative runtimes before release.

Node.jsBunDenoCloudflare

Use it, break it, tell us

Everything is developed in public. Open an issue, send a patch, or just take the package and go.

Visulima on GitHub
Anolilab Jungle