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

canada-acb

v0.1.2

Published

Canadian ACB parsing and analysis utilities for ANET equity compensation PDFs

Readme

canada-acb

Standalone TypeScript/npm package for the core anet-acb data pipeline:

  • PDF parsing for ANET sell, RSU release, and ESPP purchase confirmations
  • CRA-style USD/CAD exchange-rate lookup from the Bank of Canada
  • Transaction normalization, ACB calculation, and tax-year summaries
  • CSV and audit exports derived from the generated ledger

The package is browser-friendly and is designed to be consumed by a UI layer that handles uploads, state, and visualization.

Install

npm install canada-acb

For local development alongside the original site:

{
  "dependencies": {
    "canada-acb": "file:../canada-acb"
  }
}

Usage

import {
  fetchExchangeRates,
  generateAcbData,
  parsePdfs,
  exportAcbToCsv,
} from "canada-acb";

const parsed = await parsePdfs(files);
const dates = generateAcbData(parsed, {}).allDates;
const exchangeRates = await fetchExchangeRates(dates);
const data = generateAcbData(parsed, exchangeRates);
const csv = exportAcbToCsv(data.acbEntries);

API

Root exports include:

  • PDF parsing helpers: parsePdf, parsePdfs, extractPdfText
  • Core data pipeline: buildNormalizedTransactions, collectTransactionDates, generateAcbData
  • Analysis: calculateAcb, summarizeByTaxYear
  • Exchange rates: fetchExchangeRates
  • Output helpers: exportAcbToCsv, exportTaxYearsToCsv, generateAuditReport, exportForAcbTool, generateTamperMonkeyScript
  • WealthSimple Tax auto-fill script generator: generateWsTamperScript (generic), generateTamperMonkeyScript (ANET-specific convenience wrapper)
  • Supporting types and split-normalization utilities

generateWsTamperScript

Generates a Tampermonkey UserScript that auto-fills capital gains dispositions in WealthSimple Tax.

import { generateWsTamperScript } from 'canada-acb';

const script = generateWsTamperScript(
  [
    {
      description: 'FOO 2024-03-15',
      settlementDate: '2024-03-15',
      proceeds: 1000,
      costBase: 800,
      expenses: 5,
    },
  ],
  2024,
  { label: 'FOO' },
);

generateTamperMonkeyScript(AcbEntry[], year) is an ANET-specific convenience wrapper around generateWsTamperScript that maps AcbEntry fields, filters in only sell transactions and passes label: 'ANET'.

Development

Install dependencies (includes dev tooling for build, typecheck, and tests):

npm install

Tests

Unit tests use Vitest. Test files live alongside sources as src/*.test.ts.

npm test           # run the suite once
npm run test:watch # re-run on file changes

Node 18+ is supported by the pinned vitest@^2 (newer majors require Node 20+).

Typecheck and build

npm run typecheck  # tsc --noEmit
npm run build      # tsup bundle to dist/