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

twc-utils

v1.0.20

Published

A TypeScript package with Proto types, React components, and Next.js optimized components

Readme

TWC Utils

A TypeScript package with Proto types and React components for modern web development.

Installation

npm install twc-utils

Usage

All-in-one import

import {
  Calculator,
  Counter,
  Toggle,
  Card,
  Button,
  Agent,
  ExternalAgent,
} from 'twc-utils';

// React components
const MyApp = () => (
  <div>
    <Calculator
      initialValue={10}
      onCalculate={(result) => console.log(result)}
    />
    <Counter initialCount={0} step={1} />
    <Toggle label="Power Switch" />
  </div>
);

// Proto types
const agent = new Agent();
agent.name = 'Test Agent';

Modular imports

// React components only
import {
  Calculator,
  Counter,
  Toggle,
  Card,
  Button,
} from 'twc-utils/components';

// Proto types only
import { Agent, ExternalAgent, Address } from 'twc-utils/proto';

React Components

Calculator

Math calculator with basic operations.

interface CalculatorProps {
  initialValue?: number;
  onCalculate?: (result: number) => void;
}

<Calculator
  initialValue={0}
  onCalculate={(result) => console.log('Result:', result)}
/>;

Counter

Increment/decrement counter component.

interface CounterProps {
  initialCount?: number;
  step?: number;
  onCountChange?: (count: number) => void;
}

<Counter
  initialCount={0}
  step={1}
  onCountChange={(count) => console.log('Count:', count)}
/>;

Toggle

On/off toggle switch component.

interface ToggleProps {
  initialValue?: boolean;
  onToggle?: (value: boolean) => void;
  label?: string;
}

<Toggle
  initialValue={false}
  label="Power Switch"
  onToggle={(value) => console.log('Toggle:', value)}
/>;

Card

Container component with title and content.

interface CardProps {
  title?: string;
  children?: React.ReactNode;
  className?: string;
  style?: React.CSSProperties;
}

<Card title="Sample Card" style={{ backgroundColor: '#f8f9fa' }}>
  <p>Card content goes here</p>
</Card>;

Button

Styled button with variants and sizes.

interface ButtonProps {
  children: React.ReactNode;
  onClick?: () => void;
  variant?: 'primary' | 'secondary' | 'danger';
  size?: 'small' | 'medium' | 'large';
  disabled?: boolean;
  className?: string;
  style?: React.CSSProperties;
}

<Button variant="primary" size="large" onClick={() => alert('Clicked!')}>
  Click me
</Button>;

Proto Types

  • Agent - Agent proto type
  • ExternalAgent - External agent proto type
  • Address - Address proto type
  • Error - Error proto type
  • Event - Event proto type
  • FileUpload - File upload proto type
  • LineChannel - LINE channel proto type
  • LineMessage - LINE message proto type
  • AIService - AI service proto type

Module Structure

twc-utils/
├── dist/
│   ├── index.js              # Main entry point
│   ├── components/
│   │   ├── index.js          # Components entry point
│   │   ├── Calculator.js     # Calculator component
│   │   ├── Counter.js        # Counter component
│   │   ├── Toggle.js         # Toggle component
│   │   ├── Card.js           # Card component
│   │   └── Button.js         # Button component
│   └── proto.js              # Proto types
└── src/
    ├── index.ts              # Main exports
    ├── components/           # React components
    │   ├── index.ts          # Component exports
    │   ├── Calculator.tsx    # Calculator component
    │   ├── Counter.tsx       # Counter component
    │   ├── Toggle.tsx        # Toggle component
    │   ├── Card.tsx          # Card component
    │   └── Button.tsx        # Button component
    └── proto.ts              # Proto type exports

Development

# Install dependencies
npm install

# Build
npm run build

# Generate proto types
npm run proto

License

ISC