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 πŸ™

Β© 2025 – Pkg Stats / Ryan Hefner

zeed

v1.1.1

Published

🌱 Simple foundation library

Downloads

3,564

Readme

🌱 Zeed

A zero-dependency TypeScript utility library for universal JavaScript

npm version License TypeScript

Documentation β€’ GitHub β€’ Codeberg


[!CAUTION] The main repository is now at https://codeberg.org/holtwick/zeed to strengthen European sovereignty. Learn more at UnplugTrump.

✨ Features

🎯 Type-Safe

Strict TypeScript with full type inference

πŸ“¦ Zero Dependencies

Lightweight and completely tree-shakable

🌍 Universal

Works in browsers, Node.js, Deno, and Bun

⚑ Modern ESM

ES Modules with CommonJS fallback

βœ… Well Tested

Comprehensive test coverage

πŸ”Œ Standard Schema

Compatible with tRPC, TanStack, Hono & more

πŸš€ Quick Start

npm install zeed
# or
pnpm add zeed
# or
yarn add zeed

πŸ“š Core Features

πŸͺ΅ Universal Logging

Powerful, filterable logging for browser and terminal with colorful output and stack traces.

import { Logger } from 'zeed'

const log = Logger('demo')

log('Hello World')
log.info('Info')
log.warn('Warning')
log.error('Error')

Terminal output:

Browser output:

Filtering:

By default, logs are muted. Enable them with filters:

Browser:

localStorage.zeed = '*'

Node.js:

ZEED=* node myapp.js

You can use advanced filters compatible with debug syntax. Use ZEED or DEBUG environment variables (ZEED supersedes DEBUG).

Filter by level: ZEED_LEVEL=info to hide debug logs.

Write to file: ZEED_LOG=/path/to/file.log

Log Handlers:

  • LoggerConsoleHandler(opt) - Plain console output
  • LoggerBrowserHandler(opt) - Colorful browser logs
  • LoggerNodeHandler(opt) - Colorful Node.js logs
  • LoggerFileHandler(path, opt) - File output with optional rotation

Log Rotation Example:

import { LoggerFileHandler } from 'zeed'

LoggerFileHandler('/var/log/app.log', {
  rotation: {
    size: '10M',
    maxFiles: 5,
    compress: 'gzip'
  }
})

βš™οΈ Async/Promise Utilities

Powerful utilities for working with async operations:

// Wait for an event
await waitOn(emitter, 'action', 1000)

// Sleep for milliseconds
await sleep(1000)

// Timeout a promise
await timeout(asyncFn, 1000)

// Ensure a value is a Promise
await promisify(returnValue)

πŸ†” Unique ID Generation

Multiple ID generation strategies for different use cases:

// UUID (Base62, 22 chars) - cryptographically secure
const id = uuid()

// Sortable UID with timestamp
const sortable = suid()
suidDate(sortable) // Extract timestamp

// Named incremental IDs (great for debugging)
uname('user') // => 'user-0'
uname('user') // => 'user-1'

// Classic UUID v4
const classic = uuidv4() // => 'a7755f8d-ef6f-45e9-8db3-d29347a4a2a1'

Available ID types: uuid, uuidB32, suid, quid, uuidv4


🎯 Typed Event Emitter

Type-safe, async event emitter with full TypeScript support:

interface MyEvents {
  inc: (count: number) => number
}

const e = new Emitter<MyEvents>()
e.on('inc', async count => counter + 1)
await e.emit('inc', 1)

// Or use the .call proxy
await e.call.inc(1)

Global emitter for cross-module communication:

declare global {
  interface ZeedGlobalEmitter {
    test: (x: string) => void
  }
}

getGlobalEmitter().call.test('Hello World')

πŸ’¬ Messaging

Type-safe messaging infrastructure for client-server communication:

const m = useMessageHub({ channel }).send<MyMessages>()
m.echo({ hello: 'world' })

πŸ“– Full messaging documentation


βœ… Schema Validation

🎯 Type-safe β€’ πŸ”„ Standard Schema Compatible β€’ πŸš€ Zero Dependencies

Powerful schema validation with full TypeScript inference and Standard Schema support:

import { z } from 'zeed'

// Define and validate schemas
const userSchema = z.object({
  name: z.string(),
  email: z.string(),
  age: z.number().optional(),
  role: z.stringLiterals(['admin', 'user', 'guest']),
})

// Full type inference
type User = z.infer<typeof userSchema>

// Parse and validate
const user = schemaParseObject(userSchema, data)

Compatible with tRPC, TanStack Form/Router, Hono, and 40+ other libraries:

// Use with any standard-schema-compatible library
const schema = z.object({
  name: z.string(),
  count: z.number(),
})

const result = schema['~standard'].validate({ name: 'test', count: 42 })
if (result.issues) {
  console.error('Validation failed:', result.issues)
}
else {
  console.log('Valid data:', result.value)
}

Features:

  • Primitives: string(), number(), int(), boolean(), any()
  • Objects: object(), record(), pick(), omit(), extend(), partial(), required()
  • Arrays & Tuples: array(), tuple()
  • Unions & Literals: union(), literal(), stringLiterals()
  • Modifiers: .optional(), .default(), .describe()

πŸ“– Complete schema documentation


πŸ“Š Additional Utilities

πŸ”„ CRDT Sorting

interface Row extends SortedItem {
  id: string
  title: string
}
sortedItems(rows)

πŸ” Binary Encoding

const { encode, decode } = useBase(62)
decode(encode(data)) === data

πŸ” Deep Object Utils

deepEqual(obj1, obj2)
deepMerge(obj1, obj2)

🧹 Resource Disposal

const dispose = useDispose()
dispose.add(cleanup)
await dispose()

πŸ“¦ More Features

Zeed includes many more utilities - explore the full API documentation!

🀝 Related Projects

By the same author:

  • zeed-dom - DOM manipulation utilities
  • zerva - Modular server framework

Similar utility libraries:

  • lib0 - Fundamental utility functions
  • antfu/utils - Collection of common utilities
  • vueuse - Vue composition utilities
  • unjs - Unified JavaScript tools

πŸ“„ License

MIT


Built with ❀️ by Dirk Holtwick

⭐ Star on GitHub β€’ πŸ“– Documentation β€’ πŸ› Report Issue