Registry / testing / abtn-fmt

abtn-fmt

JSON →
library1.0.0jsnpmunverified

Shared formatter helper for browser and Node.js environments. Version 1.0.0 provides a lightweight, isomorphic formatting utility that works consistently across both runtimes. Unlike larger formatting libraries, abtn-fmt focuses on simplicity and zero-dependency operation, making it suitable for projects that need basic formatting without overhead. Currently initial release with no planned release cadence documented.

npm install abtn-fmt
INSTALL
IMPORT
SIG · ABTN-FMT
A
abtn-fmt
testingjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

format
import { format } from 'abtn-fmt'
import format from 'abtn-fmt'
ESM named export; default import will fail.
formatDate
import { formatDate } from 'abtn-fmt'
const formatDate = require('abtn-fmt').formatDate
ESM-only package; require() is not supported.
formatNumber
import { formatNumber } from 'abtn-fmt'
import { formatNumber } from 'abtn-fmt/formatNumber'
No subpath exports; all symbols from package root.

Demonstrates basic formatting of strings, dates, and numbers using named imports.

import { format, formatDate, formatNumber } from 'abtn-fmt'; console.log(format('Hello %s', 'world')); // Hello world console.log(formatDate(new Date(), 'YYYY-MM-DD')); // 2025-03-12 console.log(formatNumber(1234.56, { style: 'currency', currency: 'USD' })); // $1,234.56
Debug
Known issues
gotchaMissing subpath exports — all imports must come from package root.
fix
Use `import { format } from 'abtn-fmt'` instead of `import { format } from 'abtn-fmt/format'`.
affects: 1.0.0
gotchaESM-only package; CommonJS require() will throw.
fix
Use `import` syntax or dynamic `import()` in CJS contexts.
affects: 1.0.0
gotchaDefault export is not available.
fix
Use named imports like `import { format } from 'abtn-fmt'`.
affects: 1.0.0
Errors
Common errors & fixes
SyntaxError: The requested module 'abtn-fmt' does not provide an export named 'default'
Attempting to default-import from an ESM-only package that only exports named exports.
fix
Use named import: `import { format } from 'abtn-fmt'`
ERR_REQUIRE_ESM: require() of ES Module /path/to/node_modules/abtn-fmt/index.js from /path/to/file.js not supported.
Package is ESM-only and does not support CommonJS require().
fix
Change to `import { format } from 'abtn-fmt'` or use dynamic import: `const { format } = await import('abtn-fmt')`
Module not found: Can't resolve 'abtn-fmt/format'
Trying to import from a subpath that does not exist.
fix
Import from package root: `import { format } from 'abtn-fmt'`
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
61 hits · last 30 days
node
54
OpenAI (training)
1
Resources
abtn-fmt — npm install abtn-fmt · libregistry