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

ai-business

v0.1.0

Published

Business types and functions for AI applications

Readme

ai-business

npm version License: MIT

Business types and functions for AI applications

Overview

ai-business is a package that exports commonly used business types and functions, including Goals (Objectives & Key Results), Plans, Lean Canvas, StoryBrand, and more.

Installation

npm install ai-business
# or
yarn add ai-business
# or
pnpm add ai-business

Usage

Goals and OKRs

import { Goal, Objective, KeyResult } from 'ai-business'

// Example of defining an objective with key results
const objective: Objective = {
  description: 'Improve user acquisition',
  keyResults: [
    {
      description: 'Increase website traffic by 20%',
      target: 20,
      currentValue: 5,
      unit: '%',
    },
    'Launch 3 new marketing campaigns',
  ],
}

Plans

import { Plan, PlanStep } from 'ai-business'

// Example of defining a plan with steps
const plan: Plan = {
  id: '1',
  name: 'Product Launch Plan',
  description: 'Step-by-step plan for launching our new product',
  status: 'draft',
  steps: [
    {
      id: '1',
      name: 'Market Research',
      description: 'Conduct market research to validate product fit',
      order: 1,
      status: 'in_progress',
    },
    {
      id: '2',
      name: 'Marketing Materials',
      description: 'Create all marketing materials',
      order: 2,
      status: 'not_started',
    },
  ],
  updatedAt: new Date().toISOString(),
  createdAt: new Date().toISOString(),
}

StoryBrand Framework

import { storyBrand } from 'ai-business'

// Generate a StoryBrand framework
const result = await storyBrand({ company: 'Example Inc', product: 'AI Assistant' })

console.log(result)
// {
//   productName: 'AI Assistant',
//   hero: 'Busy professionals who struggle with productivity',
//   problem: {
//     external: 'Too many tasks and not enough time',
//     internal: 'Feeling overwhelmed and inefficient',
//     philosophical: 'Work should enable life, not consume it',
//     villain: 'Fragmented tools and disorganized workflows'
//   },
//   guide: 'AI Assistant positions itself as an experienced guide with deep expertise in productivity',
//   plan: ['Sign up for a free trial', 'Connect your existing tools', 'Let AI learn your workflow'],
//   callToAction: 'Start your free trial today',
//   success: 'Reclaim hours of your day with streamlined workflows and automated task management',
//   failure: 'Continue struggling with fragmented tools and mounting to-do lists',
//   messagingExamples: ['Your AI productivity partner', 'Work smarter, not harder', 'Let AI handle the routine so you can focus on what matters']
// }

Lean Canvas

import { leanCanvas } from 'ai-business'

// Generate a Lean Canvas
const canvas = await leanCanvas({ company: 'Example Inc', product: 'AI Assistant' })

console.log(canvas)
// {
//   productName: 'AI Assistant',
//   problem: ['Information overload', 'Task management complexity', 'Meeting scheduling inefficiency'],
//   solution: ['Smart task prioritization', 'Automated scheduling', 'Context-aware information filtering'],
//   uniqueValueProposition: 'Reclaim 10 hours per week with AI that truly understands your work',
//   unfairAdvantage: 'Proprietary context-aware AI that learns individual work patterns',
//   customerSegments: ['Knowledge workers', 'Executives', 'Small business owners'],
//   keyMetrics: ['User engagement time', 'Tasks automated', 'Time saved per user'],
//   channels: ['Direct website', 'App stores', 'Partner integrations'],
//   costStructure: ['AI infrastructure', 'Development team', 'Marketing'],
//   revenueStreams: ['Freemium subscriptions', 'Enterprise licenses', 'API access']
// }

API Reference

Types

  • Goal - Definition of a goal with metrics and status
  • Milestone - Definition of a goal milestone
  • KeyResult - Definition of a key result for objectives
  • Objective - Definition of an objective with key results
  • Plan - Definition of a strategic plan
  • PlanStep - Definition of a step within a plan

Functions

  • storyBrand(input, config?) - Generate a StoryBrand framework
  • leanCanvas(input, config?) - Generate a Lean Canvas business model

Dependencies

  • ai-providers - Abstraction layer for different AI service providers
  • payload - Headless CMS for collection models
  • zod - TypeScript-first schema validation