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

transaction-signal

v1.6.1

Published

Local, deterministic extraction of transaction signals from financial messages

Readme

transaction-signal

Local, deterministic extraction of transaction signals from financial messages for JavaScript and React Native.

This library answers one core question:

Is this message a real transaction signal right now?

Features

  • Local parsing (no network calls)
  • Deterministic rule-based engine (no ML)
  • Transaction amount and merchant extraction
  • Single transaction time output (transaction_time)
  • Category inference (category, category_confidence)
  • Intent and false-positive control (transactional vs marketing)
  • Indian banking format support (UPI, card, IMPS, NEFT, clearing)
  • TypeScript types and ESM/CJS builds

Installation

npm install transaction-signal

Usage

As a library

import { analyzeSignal } from 'transaction-signal';

const signals = analyzeSignal({
  body: 'Dear Customer, Rs.137.00 has been debited from account to VPA merchant...',
  sender: '[email protected]',
  subject: 'Transaction Alert',
  rule_version: 'v1',
});

console.log(signals[0]);
// {
//   transaction_time: '2026-02-07T18:30:00',
//   direction: 'Outflow',
//   approx_amount_minor: 13700,
//   merchant_hint: 'RAJDEEP SALES CORPORATION',
//   category: 'Misc',
//   category_confidence: 0.3,
//   state: 'Completed',
//   confidence: 0.85,
//   intent: 'transactional',
//   vetoed: false
// }

As a CLI

# using npx
npx transaction-signal email.txt

# after global install
transaction-signal email.txt

# local dev
npm run cli email.txt

The CLI reads file content and prints JSON output.

Output fields

Each call returns Signal[].

  • transaction_time: single transaction time field. Format is YYYY-MM-DD if message time is unavailable, else YYYY-MM-DDTHH:mm:ss
  • direction: Inflow or Outflow
  • approx_amount_minor?: inferred amount in minor units (paise)
  • merchant_hint?: extracted merchant/counterparty
  • category?: one of transaction categories (including Investment)
  • category_confidence?: confidence for category inference
  • state: Completed | Pending | Blocked | Refunded
  • confidence: overall signal confidence (0.05 to 0.85)
  • intent?: transactional | marketing | unknown
  • vetoed?: hard veto for marketing/noise

Development

npm install
npm run typecheck
npm test
npm run build

See DEVELOPER.md for architecture, design, and contributor workflow.

License

MIT