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

parse-cfi

v0.0.1

Published

Parse ISO 10962 CFI codes into category, group, and attributes. Classification of Financial Instruments decoder. Zero dependencies.

Downloads

35

Readme

parse-cfi

Parse ISO 10962 CFI (Classification of Financial Instruments) codes into structured data.

Decompose a 6-character CFI code into category, group, and four attributes with human-readable labels.

Zero dependencies. Pure functions. TypeScript types included.

Installation

npm install parse-cfi

Usage

import { parseCFI, isValidCFI } from 'parse-cfi';

// Decompose a CFI code
const result = parseCFI('ESVUFR');

result.valid        // true
result.category     // { code: 'E', label: 'Equities' }
result.group        // { code: 'S', label: 'Common/ordinary shares' }
result.attributes   // [
                    //   { code: 'V', label: 'Voting' },
                    //   { code: 'U', label: 'Unrestricted' },
                    //   { code: 'F', label: 'Fully paid' },
                    //   { code: 'R', label: 'Registered' }
                    // ]
result.description  // "Equities — Common/ordinary shares (Voting, Unrestricted, Fully paid, Registered)"

// Quick validation
isValidCFI('ESVUFR')  // true
isValidCFI('123456')  // false

API

parseCFI(cfi: string): CFIResult

Parse a 6-character CFI code. Never throws. Returns { valid: false } for invalid input.

isValidCFI(cfi: string): boolean

Check if a string is a structurally valid CFI code with a recognized category.

Supported Categories

| Code | Category | |------|----------| | E | Equities | | D | Debt instruments | | C | Collective investment vehicles | | R | Entitlements (rights) | | O | Listed options | | F | Futures | | S | Swaps | | H | Non-listed and complex listed options | | I | Spot | | J | Forwards | | K | Strategies | | L | Financing | | T | Referential instruments | | M | Others (miscellaneous) |

Examples

// Bond: fixed rate, government guarantee, fixed maturity, registered
parseCFI('DBFTFR').description
// "Debt instruments — Bonds (Fixed rate, Government/state guarantee, Fixed maturity, Registered)"

// ETF with unspecified attributes
parseCFI('CEXXXX').description
// "Collective investment vehicles — Exchange-traded funds (ETFs)"

// Listed call option: American, stock underlying, cash settled, standardized
parseCFI('OCASCS').description
// "Listed options — Call options (American, Stock-equities, Cash, Standardized)"

Why Use This?

  • FIX Protocol: CFI codes appear in FIX messages (tag 461). Decode them to route orders correctly.
  • MiFID II reporting: Regulatory submissions require CFI classification. Parse and validate before filing.
  • ISIN databases: Every ISIN record includes a CFI code. Enrich your security master with structured attributes.
  • ANNA service bureau: CFI is assigned alongside ISIN by national numbering agencies.

Related

License

MIT