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

@flowtile/core

v0.1.0

Published

Framework-agnostic ticket workflow engine with TypeScript-first API

Downloads

8

Readme

@flowtile/core

Framework-agnostic ticket workflow engine with TypeScript-first API.

Installation

npm install @flowtile/core

Quick Start

import { TicketEngine, WorkflowBuilder, MemoryAdapter } from '@flowtile/core';

// Create a workflow
const workflow = new WorkflowBuilder('my-workflow', 'My Workflow')
  .addStage('todo', {
    label: 'To Do',
    requiredFields: ['Title'],
    optionalFields: ['Description'],
    exitCriteria: 'Ready to start',
    color: '#6b7280',
  })
  .addStage('in_progress', {
    label: 'In Progress',
    requiredFields: ['Assignee'],
    optionalFields: ['Notes'],
    exitCriteria: 'Work is being done',
    color: '#3b82f6',
  })
  .addStage('done', {
    label: 'Done',
    requiredFields: ['Completion notes'],
    optionalFields: [],
    exitCriteria: 'Complete',
    color: '#10b981',
  })
  .build();

// Create engine
const engine = new TicketEngine({
  workflow,
  storage: new MemoryAdapter(),
});

// Create a ticket
const ticket = await engine.createTicket({
  title: 'Fix login bug',
  currentStage: 'todo',
});

// Add an entry
await engine.addEntry(ticket.id, {
  ticketId: ticket.id,
  stageKey: 'todo',
  kind: 'note',
  body: 'User reports they cannot log in',
  createdBy: '[email protected]',
});

// Advance to next stage
await engine.advanceStage(ticket.id, {
  madeBy: '[email protected]',
  confidence: 'high',
});

Preset Workflows

Use built-in workflow presets:

import { presets, TicketEngine, MemoryAdapter } from '@flowtile/core';

// Property maintenance workflow
const engine = new TicketEngine({
  workflow: presets.maintenance(),
  storage: new MemoryAdapter(),
});

// Other presets:
// - presets.kanban()
// - presets.bugTracker()
// - presets.helpDesk()

Custom Storage Adapters

Implement the StorageAdapter interface to integrate with any database:

import { StorageAdapter, Ticket } from '@flowtile/core';

class PostgresAdapter implements StorageAdapter {
  async getAll() {
    // Your implementation
  }

  async getById(id: string) {
    // Your implementation
  }

  async create(ticket: Ticket) {
    // Your implementation
  }

  async update(ticket: Ticket) {
    // Your implementation
  }

  async delete(id: string) {
    // Your implementation
  }
}

Events

Listen to ticket lifecycle events:

engine.on('ticket:created', (ticket) => {
  console.log('New ticket:', ticket.title);
});

engine.on('stage:advanced', ({ ticket, fromStage, toStage }) => {
  console.log(`Ticket ${ticket.id} moved from ${fromStage} to ${toStage}`);
});

Custom Exit Criteria Validators

Add custom validation logic:

const validators = new Map();

validators.set('verify', async (ticket, stageKey) => {
  const photos = ticket.entries.filter(
    (e) => e.stageKey === stageKey && e.kind === 'photo'
  );

  if (photos.length < 2) {
    return {
      valid: false,
      reason: 'At least 2 photos are required',
    };
  }

  return { valid: true };
});

const engine = new TicketEngine({
  workflow,
  storage: new MemoryAdapter(),
  validators,
});

API Reference

See the full documentation for detailed API reference.

License

MIT