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

@bakissation/dinar

v1.1.0

Published

Type-safe Algerian Dinar (DZD) money value type for TypeScript — integer-precise centimes, float-safe arithmetic, remainder-free allocation, and fr/ar formatting. Zero dependencies.

Readme

@bakissation/dinar

A type-safe Algerian Dinar (DZD) money type for TypeScript. Amounts are stored as integer centimes, so arithmetic never drifts into floating-point error — and it ships with zero runtime dependencies.

npm CI license

  • 🪙 Integer-precise — every amount is an integer number of centimes; no 0.1 + 0.2 surprises.
  • Remainder-free allocation — split a total across shares without creating or losing a centime.
  • 🧮 Money-correct roundinghalf-up (default), half-even, floor, ceil for VAT/percentage math.
  • 🌍 fr / ar formatting & parsing — render 1 234,56 DA / 1 234,56 دج; parse messy human and CSV input.
  • 🧩 Zero dependencies, ESM + CommonJS, strict types.

Install

npm install @bakissation/dinar

Requires Node.js ≥ 18. No runtime dependencies.

Quick start

import { Dinar } from '@bakissation/dinar';

const price = Dinar.fromDinars(1500);               // 1 500,00 DA
const total = price.add(price.percentage(19));      // + 19% VAT
console.log(total.format());                        // "1 785,00 DA"

// Split a bill three ways — no lost centime
Dinar.fromCentimes(100).allocate([1, 1, 1]);        // 34 + 33 + 33

// Minor units, exactly what the SATIM gateway expects
price.toCentimes();                                 // 150000

// Parse messy human / CSV input
Dinar.fromString('1 234,56 DA').centimes;           // 123456

Why centimes?

Money in floating point is a bug waiting to happen (0.1 + 0.2 !== 0.3). Dinar keeps every value as an integer count of centimes (1 DA = 100 centimes) and only converts to a decimal for display. That single invariant is what makes totals, taxes, and splits trustworthy. See docs/overview.

Documentation

Full docs live in docs/:

| | | |---|---| | Overview & concepts | Why a money type, the centimes invariant, rounding, glossary | | Getting started | Install, construct, the common recipes | | API reference | Every constructor, method, and option on Dinar | | Architecture | Internals: the integer invariant, the allocation algorithm, parsing & formatting |

A foundation for Algerian fintech

dinar is a foundational money primitive for open, direct-integration TypeScript tooling around Algerian payments and fiscal workflows. Because every amount is integer centimes, toCentimes() returns exactly the minor-units value payment gateways expect.

Contributing

Issues and PRs welcome — read CONTRIBUTING.md and the Code of Conduct. Releases are automated from Conventional Commits via semantic-release; don't bump the version or edit the changelog by hand.

Credits

Built and maintained by Abdelbaki Berkatiberkati.xyz · @bakissation.

License

MIT