{"_id":"@bakissation/dinar","_rev":"4-baa8379d4a178f7afa90f44cafa16fd2","name":"@bakissation/dinar","dist-tags":{"latest":"1.1.0","dev":"1.1.0-alpha.1","staging":"1.1.0-beta.1"},"versions":{"1.0.0":{"name":"@bakissation/dinar","version":"1.0.0","keywords":["dinar","dzd","algeria","money","currency","value-object","decimal","centimes","fintech","typescript"],"author":{"url":"@bakissation","name":"Abdelbaki Berkati"},"license":"MIT","_id":"@bakissation/dinar@1.0.0","maintainers":[{"name":"bakissation","email":"abdelbaki.berkati@gmail.com"}],"homepage":"https://github.com/bakissation/dinar#readme","bugs":{"url":"https://github.com/bakissation/dinar/issues"},"dist":{"shasum":"7f570c2803f0352795bda389fdb2589ea59c380b","tarball":"https://registry.npmjs.org/@bakissation/dinar/-/dinar-1.0.0.tgz","fileCount":9,"integrity":"sha512-w6+62qeBqcCG7KSz7U4VGmNmNsS+l+LucNt280qnMrJb7CXir2kh6XFU8hNSMEZu0tnarkSH5JY2gXrkIFpnqw==","signatures":[{"sig":"MEUCIQC/BI2+blvROqXH99q7rWZVJzhIWLGJMiRcsWc4eVfdHwIgQiNuV9Lcd/DQI97dPSkjvMn4TvxTTWqsnIhtW67s45c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69237},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"10f6ea0bbb994a75bc2faab2fc94682412005232","scripts":{"dev":"tsup --watch","lint":"eslint .","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"bakissation","email":"abdelbaki.berkati@gmail.com"},"repository":{"url":"git+https://github.com/bakissation/dinar.git","type":"git"},"_npmVersion":"10.9.3","description":"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.","directories":{},"sideEffects":false,"_nodeVersion":"22.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.1","eslint":"^9.18.0","vitest":"^1.2.0","@eslint/js":"^9.18.0","typescript":"^5.3.3","@types/node":"^20.10.0","semantic-release":"^25.0.3","typescript-eslint":"^8.20.0"},"_npmOperationalInternal":{"tmp":"tmp/dinar_1.0.0_1779482762188_0.28711949665314584","host":"s3://npm-registry-packages-npm-production"}},"1.1.0-alpha.1":{"name":"@bakissation/dinar","version":"1.1.0-alpha.1","keywords":["dinar","dzd","algeria","money","currency","value-object","decimal","centimes","fintech","typescript"],"author":{"url":"@bakissation","name":"Abdelbaki Berkati"},"license":"MIT","_id":"@bakissation/dinar@1.1.0-alpha.1","maintainers":[{"name":"bakissation","email":"abdelbaki.berkati@gmail.com"}],"homepage":"https://github.com/bakissation/dinar#readme","bugs":{"url":"https://github.com/bakissation/dinar/issues"},"dist":{"shasum":"da890b2899f14a9fa6f65cd3d0e94adf098977b4","tarball":"https://registry.npmjs.org/@bakissation/dinar/-/dinar-1.1.0-alpha.1.tgz","fileCount":9,"integrity":"sha512-0O1FZD+q9RQKKHO2VKq5xgI9xityYZoUzUB2YZYj1gUSRx8Dux+ueWpwbcU7ZyB92tUSCEfbE4jwN3pP9cwP2g==","signatures":[{"sig":"MEUCIQDE7jcgI545i3OsojnCKEixpqfh5mDVyyjgg15wiOB44QIgB9FkXedmxjp78dnPcV5QebXaMVTZ5H+fYWIfdBXSDvU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bakissation%2fdinar@1.1.0-alpha.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":72643},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"1f9abc51c2b948df088f1be765a7f22b9d3d38c2","scripts":{"dev":"tsup --watch","lint":"eslint .","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f6434653-6c0c-4ec8-b438-e329e3134af2"}},"repository":{"url":"git+https://github.com/bakissation/dinar.git","type":"git"},"_npmVersion":"11.15.0","description":"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.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^8.0.1","eslint":"^9.18.0","vitest":"^1.2.0","@eslint/js":"^9.18.0","typescript":"^5.3.3","@types/node":"^20.10.0","semantic-release":"^25.0.3","typescript-eslint":"^8.20.0"},"_npmOperationalInternal":{"tmp":"tmp/dinar_1.1.0-alpha.1_1779483438266_0.6914534181186391","host":"s3://npm-registry-packages-npm-production"}},"1.1.0-beta.1":{"name":"@bakissation/dinar","version":"1.1.0-beta.1","keywords":["dinar","dzd","algeria","money","currency","value-object","decimal","centimes","fintech","typescript"],"author":{"url":"@bakissation","name":"Abdelbaki Berkati"},"license":"MIT","_id":"@bakissation/dinar@1.1.0-beta.1","maintainers":[{"name":"bakissation","email":"abdelbaki.berkati@gmail.com"}],"homepage":"https://github.com/bakissation/dinar#readme","bugs":{"url":"https://github.com/bakissation/dinar/issues"},"dist":{"shasum":"71255b79cc7434eef8e6dcc8ee356d98a33259d1","tarball":"https://registry.npmjs.org/@bakissation/dinar/-/dinar-1.1.0-beta.1.tgz","fileCount":9,"integrity":"sha512-GV1h5UXzELManfHvTbU21RmymjgwJqY9/8nw0vaeVRSp0mEWEqfTf/qtGngY6l1cwSoE0OXtn8J1vXZ+kIBNVA==","signatures":[{"sig":"MEUCIAD7PEokqLqwlJEwbQdB2fJ/31MHVFGqa8B5aV9GWQWWAiEA9B6FNDRarGJ2S8dxoeiYsRQ4jQP8lUACUsTQpPQlyUY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bakissation%2fdinar@1.1.0-beta.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":72642},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"1e8a44c4a409277eaaea409e37c23faf406a771e","scripts":{"dev":"tsup --watch","lint":"eslint .","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f6434653-6c0c-4ec8-b438-e329e3134af2"}},"repository":{"url":"git+https://github.com/bakissation/dinar.git","type":"git"},"_npmVersion":"11.15.0","description":"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.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^8.0.1","eslint":"^9.18.0","vitest":"^1.2.0","@eslint/js":"^9.18.0","typescript":"^5.3.3","@types/node":"^20.10.0","semantic-release":"^25.0.3","typescript-eslint":"^8.20.0"},"_npmOperationalInternal":{"tmp":"tmp/dinar_1.1.0-beta.1_1779483487980_0.9413638660633981","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@bakissation/dinar","version":"1.1.0","description":"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.","author":{"name":"Abdelbaki Berkati","url":"@bakissation"},"license":"MIT","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","lint":"eslint .","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"devDependencies":{"@eslint/js":"^9.18.0","@types/node":"^20.10.0","eslint":"^9.18.0","semantic-release":"^25.0.3","tsup":"^8.0.1","typescript":"^5.3.3","typescript-eslint":"^8.20.0","vitest":"^1.2.0"},"keywords":["dinar","dzd","algeria","money","currency","value-object","decimal","centimes","fintech","typescript"],"publishConfig":{"access":"public","provenance":true},"repository":{"type":"git","url":"git+https://github.com/bakissation/dinar.git"},"bugs":{"url":"https://github.com/bakissation/dinar/issues"},"homepage":"https://github.com/bakissation/dinar#readme","gitHead":"eb223bdd837e1e9efecb984f71390fecc41395d6","_id":"@bakissation/dinar@1.1.0","_nodeVersion":"24.15.0","_npmVersion":"11.15.0","dist":{"integrity":"sha512-A96xmr1mJkSnxHRyJxjQa31APs4qFbsEbgI6i9Ia7R/KF9cGhnd2vy8xLBWj9VVXd0cRhbWdfoiEP5ulOPEYDg==","shasum":"30cceca5bee690ef4cc32fb6c61a84de9b398765","tarball":"https://registry.npmjs.org/@bakissation/dinar/-/dinar-1.1.0.tgz","fileCount":9,"unpackedSize":72635,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bakissation%2fdinar@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCRs+qwS60vgV8Fzfs7JbP0MhOslbFGlD1EJqTc4tIdVgIgcHO/Pv7/6D4Gg+qbaIvgDmeymxVLKaRoVTGXOhUCZvo="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f6434653-6c0c-4ec8-b438-e329e3134af2"}},"directories":{},"maintainers":[{"name":"bakissation","email":"abdelbaki.berkati@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dinar_1.1.0_1779483530519_0.48900017490649317"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-22T20:46:01.947Z","modified":"2026-05-22T20:58:50.922Z","1.0.0":"2026-05-22T20:46:02.353Z","1.1.0-alpha.1":"2026-05-22T20:57:18.403Z","1.1.0-beta.1":"2026-05-22T20:58:08.127Z","1.1.0":"2026-05-22T20:58:50.657Z"},"bugs":{"url":"https://github.com/bakissation/dinar/issues"},"author":{"name":"Abdelbaki Berkati","url":"@bakissation"},"license":"MIT","homepage":"https://github.com/bakissation/dinar#readme","keywords":["dinar","dzd","algeria","money","currency","value-object","decimal","centimes","fintech","typescript"],"repository":{"type":"git","url":"git+https://github.com/bakissation/dinar.git"},"description":"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.","maintainers":[{"name":"bakissation","email":"abdelbaki.berkati@gmail.com"}],"readme":"# @bakissation/dinar\n\nA **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**.\n\n[![npm](https://img.shields.io/npm/v/@bakissation/dinar?label=npm&color=cb3837)](https://www.npmjs.com/package/@bakissation/dinar)\n[![CI](https://github.com/bakissation/dinar/actions/workflows/ci.yml/badge.svg)](https://github.com/bakissation/dinar/actions/workflows/ci.yml)\n[![license](https://img.shields.io/npm/l/@bakissation/dinar?color=blue)](./LICENSE)\n\n- 🪙 **Integer-precise** — every amount is an integer number of centimes; no `0.1 + 0.2` surprises.\n- ➗ **Remainder-free allocation** — split a total across shares without creating or losing a centime.\n- 🧮 **Money-correct rounding** — `half-up` (default), `half-even`, `floor`, `ceil` for VAT/percentage math.\n- 🌍 **fr / ar formatting & parsing** — render `1 234,56 DA` / `1 234,56 دج`; parse messy human and CSV input.\n- 🧩 **Zero dependencies, ESM + CommonJS, strict types.**\n\n## Install\n\n```bash\nnpm install @bakissation/dinar\n```\n\nRequires **Node.js ≥ 18**. No runtime dependencies.\n\n## Quick start\n\n```typescript\nimport { Dinar } from '@bakissation/dinar';\n\nconst price = Dinar.fromDinars(1500);               // 1 500,00 DA\nconst total = price.add(price.percentage(19));      // + 19% VAT\nconsole.log(total.format());                        // \"1 785,00 DA\"\n\n// Split a bill three ways — no lost centime\nDinar.fromCentimes(100).allocate([1, 1, 1]);        // 34 + 33 + 33\n\n// Minor units, exactly what the SATIM gateway expects\nprice.toCentimes();                                 // 150000\n\n// Parse messy human / CSV input\nDinar.fromString('1 234,56 DA').centimes;           // 123456\n```\n\n## Why centimes?\n\nMoney 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](./docs/overview.md)**.\n\n## Documentation\n\nFull docs live in **[`docs/`](./docs/)**:\n\n| | |\n|---|---|\n| [Overview & concepts](./docs/overview.md) | Why a money type, the centimes invariant, rounding, glossary |\n| [Getting started](./docs/getting-started.md) | Install, construct, the common recipes |\n| [API reference](./docs/api-reference.md) | Every constructor, method, and option on `Dinar` |\n| [Architecture](./docs/architecture.md) | Internals: the integer invariant, the allocation algorithm, parsing & formatting |\n\n## A foundation for Algerian fintech\n\n`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.\n\n## Contributing\n\nIssues and PRs welcome — read [CONTRIBUTING.md](./CONTRIBUTING.md) and the [Code of Conduct](./CODE_OF_CONDUCT.md). Releases are automated from [Conventional Commits](https://www.conventionalcommits.org/) via semantic-release; **don't bump the version or edit the changelog by hand**.\n\n## Credits\n\nBuilt and maintained by **Abdelbaki Berkati** — [berkati.xyz](https://berkati.xyz) · [@bakissation](https://github.com/bakissation).\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md"}