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

@tall-staik/commons

v0.0.8

Published

Shared types, schemas, and utilities for TallStaik applications

Downloads

31

Readme

@tall-staik/commons

Shared types, schemas, utilities, and constants for TallStaik applications.

Installation

npm install @tall-staik/commons
# or
pnpm add @tall-staik/commons
# or
yarn add @tall-staik/commons

Usage

Types

import type {
  User,
  Organization,
  AuthTokens,
  TenantContext,
  ApiResponse,
  UserRole,
} from "@tall-staik/commons";

// Or import from specific module
import type { User, Organization } from "@tall-staik/commons/types";

Schemas (Zod)

import {
  loginSchema,
  registerSchema,
  createOrganizationSchema,
  type LoginInput,
  type RegisterInput,
} from "@tall-staik/commons";

// Or import from specific module
import { loginSchema } from "@tall-staik/commons/schemas";

// Validate input
const result = loginSchema.safeParse(formData);
if (result.success) {
  const data: LoginInput = result.data;
}

Utilities

import {
  hasPermission,
  slugify,
  formatBytes,
  getRelativeTime,
  isValidEmail,
} from "@tall-staik/commons";

// Or import from specific module
import { hasPermission, slugify } from "@tall-staik/commons/utils";

// Check permissions
if (hasPermission(user.role, "members:invite")) {
  // Allow action
}

// Generate slug
const slug = slugify("My Organization Name"); // "my-organization-name"

Constants

import {
  ErrorCodes,
  HttpStatus,
  AuthConstants,
  PlanLimits,
} from "@tall-staik/commons";

// Or import from specific module
import { ErrorCodes, HttpStatus } from "@tall-staik/commons/constants";

// Use constants
if (response.status === HttpStatus.UNAUTHORIZED) {
  // Handle unauthorized
}

Multi-Tenant Model

This package is designed for multi-tenant applications:

  • User: Global user account that can belong to multiple organizations
  • Organization: A tenant with isolated data and settings
  • Membership: Links users to organizations with specific roles
  • TenantContext: Current user + organization context for requests

Example Flow

import type { TenantContext, User, Organization, OrganizationMembership } from "@tall-staik/commons";

// After authentication, you have a tenant context
const context: TenantContext = {
  user: { id: "user-123", email: "[email protected]", ... },
  organization: { id: "org-456", slug: "acme-corp", ... },
  membership: { role: "admin", ... },
};

// Use throughout the application
function createResource(ctx: TenantContext, data: ResourceData) {
  // All data is scoped to ctx.organization.id
}

Development

# Install dependencies
npm install

# Build
npm run build

# Watch mode
npm run dev

# Type check
npm run type-check

Versioning

We use semantic versioning. To release a new version:

# Patch release (bug fixes)
npm run release:patch

# Minor release (new features)
npm run release:minor

# Major release (breaking changes)
npm run release:major

License

MIT