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

@thiagoprazeres/parse-e2eid

v1.0.1

Published

Parse and validate Brazilian Pix endToEndId — zero runtime dependencies

Readme

@thiagoprazeres/parse-e2eid

npm license

Parse and validate Brazilian Pix endToEndId — semantic date validation included, zero runtime dependencies.

Install

npm install @thiagoprazeres/parse-e2eid

Usage

import { parseE2EId, isValidE2EId } from '@thiagoprazeres/parse-e2eid';

parseE2EId('E6074694820230615143012345678901');
// {
//   ispb: '60746948',
//   initiatedAt: Date('2023-06-15T14:30:00.000Z'),
//   suffix: '12345678901'
// }

isValidE2EId('E6074694820230615143012345678901'); // → true
isValidE2EId('invalid');                          // → false
isValidE2EId('E6074694820230231143012345678901'); // → false  (Feb 31 doesn't exist)
isValidE2EId('E6074694820230229143012345678901'); // → false  (not a leap year)

API

parseE2EId(e2eId: string): ParsedE2EId

Parses the endToEndId string. Throws Error on:

  • invalid format (wrong length, wrong prefix, non-digit ISPB)
  • impossible date/time values (month 13, day 32, Feb 31, Feb 29 on non-leap years, hour 25, minute 60…)
interface ParsedE2EId {
  ispb: string;       // 8-digit initiating institution ISPB
  initiatedAt: Date;  // UTC timestamp
  suffix: string;     // 11-char unique suffix
}

isValidE2EId(e2eId: string): boolean

Returns true if the string is a structurally and semantically valid endToEndId. Never throws.

Format

E  {ISPB — 8 digits}  {YYYY MM DD}  {HH mm}  {11 alphanumeric chars}

Total length: 32 characters.

JavaScript's Date constructor silently overflows invalid dates (Feb 31 becomes Mar 3). This package validates every component explicitly — impossible dates are rejected with a descriptive error message.

Motivation

The standard BACEN endToEndId appears in bank statements, Pix receipts, and conciliation APIs. Parsing it reliably — including rejecting impossible dates that JavaScript's Date would silently normalize — is a recurring need in fintech backends and was not available as a standalone, zero-dependency package.

Scope

  • Parses the ISPB, timestamp, and suffix from a Pix endToEndId
  • Validates format (length, prefix, character set)
  • Validates date/time semantics (no silent overflow)

Out of scope

  • Does not enrich with institution name (see @thiagoprazeres/ispb-participants)
  • Does not validate whether the ISPB exists in the SPI participant list
  • Does not make any network requests
  • Does not validate dynamic Pix endToEndIds (same format, different use case)

References

License

Apache 2.0