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 🙏

© 2025 – Pkg Stats / Ryan Hefner

o10r-pp-flow

v0.4.15

Published

`o10r-pp-flow` is a TypeScript library for building payment pages. It provides a single flow object with the methods, data and events required to initialize the payment context, handle user input and finalize the transaction.

Readme

o10r-pp-flow

o10r-pp-flow is a TypeScript library for building payment pages. It provides a single flow object with the methods, data and events required to initialize the payment context, handle user input and finalize the transaction.


📦 Installation

npm install o10r-pp-flow

Requires Node.js v24+


🚀 Usage

Create a flow

import PPFlow from 'o10r-pp-flow';
import paymentMethodFactory from '...';

const apiHost = 'https://example.com';
const flow = PPFlow(apiHost, paymentMethodFactory);

Subscribe to events

flow.on('init', (ctx) => console.log('Initialized', ctx));
flow.on('statusChanged', (ctx) => console.log('Status', ctx.paymentStatus.status));
flow.on('paymentMethodsChanged', () => console.log('Methods', flow.paymentMethods));
flow.on('languageChanged', (lang) => console.log('Language', lang));

Initialize the flow

const jwtToken = '...';
await flow.init(jwtToken);

init loads project settings, payment methods and payment status. You may also call flow.init(jwtToken) without awaiting and react to the init event.

Access the context

console.log(flow.context.amount);
console.log(flow.context.currency);

The context object is populated after init and is emitted with every event handler.

Work with payment methods

const method = flow.paymentMethods[0];

// Remove a saved payment method
await flow.remove(method);

Listen to paymentMethodsChanged to track updates to the paymentMethods array.

Change language

import { Language } from 'o10r-pp-core';

await flow.translator.setLanguage(Language.FR);
console.log(flow.translator.t('PAY'));

Pay

const method = flow.paymentMethods[0];
// Collect payment data using method's own API if needed
await flow.pay(method);

After pay, the latest payment status is requested automatically and emitted via statusChanged.

Clarify additional data

import { PaymentStatus } from 'o10r-pp-core';

if (flow.context.paymentStatus.status === PaymentStatus.AWAITING_CLARIFICATION) {
  await flow.clarify({ code: '123456' });
}

See the exported Flow, Context, EventMap and payment method types for complete type information.