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

tomalib

v1.1.1

Published

TomaLib encrypted temporary archive CLI and workspace content policy utilities.

Readme

tomalib

Environment-independent workspace content policy utilities. The package helps Node.js applications decide whether a relative file path is excluded, detect potential secrets without returning their values, and calculate SHA-256 digests for integrity checks.

Installation

npm install tomalib

Usage

JavaScript

import { WorkspaceContentPolicy, sha256 } from 'tomalib';

const policy = new WorkspaceContentPolicy();
const assessment = policy.assess('src/auth.ts', 'export function authenticate() {}');

if (assessment.decision === 'allow') {
  console.log(sha256('content to store'));
}

TypeScript

import { WorkspaceContentPolicy, type ContentAssessment } from 'tomalib';

const policy = new WorkspaceContentPolicy({
  additionalExcludedPaths: [/^internal\//]
});
const assessment: ContentAssessment = policy.assess('internal/debug.ts');

CLI

The CLI checks the health of a running API endpoint. It does not scan or upload files.

npx tomalib
npx tomalib health
npx tomalib health --url https://api.codeforge.sysdak.com

By default, health checks the deployed production API. Use --url http://127.0.0.1:8080 for the local Docker API.

Temporary Archive Transfer

Set the same secret values on both laptops. TOMALIB_API_TOKEN authorizes the API and TOMALIB_ARCHIVE_KEY encrypts archives locally (legacy CODEFORGE_* environment variables are also supported). Never store either in source code.

$env:TOMALIB_API_TOKEN = "f8355d8cf10b15306176f64b2c90a3b4b3ae6eb2d95059e9068f3f2a1bc58c32"
$env:TOMALIB_ARCHIVE_KEY = "f8355d8cf10b15306176f64b2c90a3b4b3ae6eb2d95059e9068f3f2a1bc58c32"
npx tomalib upload --file "D:\workspace.zip"
npx tomalib download --archive "archive-id" --output "D:\restored.zip"

Archives are encrypted with AES-256-GCM before direct Vercel Blob upload, limited to 50 MiB before encryption, expire after 30 minutes, and are deleted after a successful download.

API

WorkspaceContentPolicy

  • new WorkspaceContentPolicy(options?): creates a stateless policy. Default exclusions include .env*, private-key file types, credentials/, secrets/, .git/, dependency folders, and common build output.
  • isPathExcluded(relativePath): returns whether a relative path matches the exclusion policy.
  • hasPotentialSecret(content): returns whether content resembles a credential or private key. It never returns matched secret text.
  • assess(relativePath, content?): returns { decision: 'allow' | 'exclude' | 'block', reason? }.

sha256(content)

Returns the lowercase hexadecimal SHA-256 digest for a UTF-8 string or Uint8Array.

Configuration

WorkspaceContentPolicy accepts optional additionalExcludedPaths and additionalSecretPatterns arrays of regular expressions. These rules supplement, rather than remove, the secure defaults.

Error Handling

Path methods require a non-empty string. Content scanning requires a string. sha256 accepts only strings and Uint8Array values. Invalid values throw TypeError.

Compatibility

Node.js 18 or later. The package is ESM-only and has no runtime dependencies.

Development

npm install
npm run build
npm test
npm pack --dry-run

Publishing

npm login
npm publish

Publishing is intentionally manual.