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

@venturialstd/toolbox

v0.0.1

Published

Toolbox Module for Venturial - Shortcode generation and resolution

Readme

@venturialstd/toolbox

Toolbox Module for Venturial - Shortcode generation and resolution utilities.

Installation

npm install @venturialstd/toolbox

Features

  • Generate Shortcodes: Create unique alphanumeric codes with associated data
  • Resolve Shortcodes: Retrieve stored data by code
  • Expiration Support: Configurable expiration times (1 minute to 1 year)
  • One-Time Use: Optional one-time use codes that are marked as used after resolution

Usage

Import the Module

import { ToolboxModule } from '@venturialstd/toolbox';

@Module({
  imports: [ToolboxModule],
  // ...
})
export class YourModule {}

Use the Service

import { ShortcodeService } from '@venturialstd/toolbox';

@Injectable()
export class YourService {
  constructor(private readonly shortcodeService: ShortcodeService) {}

  async createShortcode() {
    const result = await this.shortcodeService.generate({
      data: { userId: '123', action: 'verify-email' },
      oneTime: true,
      length: 8,
      expirationInMinutes: 30,
    });
    
    console.log(result.code); // e.g., "ABC12345"
  }

  async resolveShortcode(code: string) {
    const result = await this.shortcodeService.resolve(code);
    console.log(result.data); // { userId: '123', action: 'verify-email' }
  }
}

API

ShortcodeService

generate(options: GenerateShortcodeOptions): Promise<ShortcodeResult>

Generates a unique shortcode.

Options:

  • data: Record<string, unknown> - Data to store (required)
  • oneTime?: boolean - If true, code can only be used once (default: false)
  • length?: number - Code length, 4-20 characters (default: 6)
  • expirationInMinutes?: number - Expiration time, 1-525600 minutes (default: 10)

Returns:

  • code: string - The generated shortcode
  • expiresAt: string | null - ISO timestamp when code expires
  • oneTime: boolean - Whether this is a one-time use code
  • createdAt: string - ISO timestamp when code was created

resolve(code: string): Promise<ResolveShortcodeResult>

Resolves a shortcode and retrieves its data.

Parameters:

  • code: string - The shortcode to resolve (required)

Returns:

  • data: Record<string, unknown> - The stored data
  • code: string - The shortcode that was resolved
  • expiresAt: string | null - ISO timestamp when code expires
  • oneTime: boolean - Whether this was a one-time use code (true if it was used)
  • createdAt: string - ISO timestamp when code was created

Throws:

  • NotFoundException - If code not found, expired, or already used

Database

The module requires a PostgreSQL database with the toolbox_shortcode table. Run migrations to create the table:

npm run migration:run

Development

Build

npm run build

Test

npm run test:dev

Publish

npm run release:patch