Registry / productivity / normalise-abn

normalise-abn

JSON →
library1.0.0jsnpmunverified

Australian Business Number (ABN) normaliser and formatter for Node.js. Current version 1.0.0 provides simple functions to validate, normalise (strip spaces/hyphens), and format ABNs with standard spacing (XX XXX XXX XXX). No dependencies, zero-config, and focused solely on ABN operations. Suitable for Australian tax/compliance applications. Stable release with no update cadence announced.

npm install normalise-abn
INSTALL
IMPORT
SIG · NORMALISE-ABN
N
normalise-abn
productivityjavascriptv1.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.

normalise
import { normalise } from 'normalise-abn'
const normalise = require('normalise-abn').normalise
ESM import; CJS require works but prefer ES import.
isValid
import { isValid } from 'normalise-abn'
Unambiguous import.
default
import normaliseABN from 'normalise-abn'
import { default as normaliseABN } from 'normalise-abn'
Default export is the normalise function, but named import is clearer.

Demonstrates ABN normalisation, validation, and formatting with default settings.

import { normalise, isValid, format } from 'normalise-abn'; const rawABN = '51 824 753 556'; const normalised = normalise(rawABN); console.log(normalised); // '51824753556' const valid = isValid(rawABN); console.log(valid); // true const formatted = format(normalised); console.log(formatted); // '51 824 753 556'
Debug
Known issues
gotchaThe function `normalise` (spelled with 's', not 'z') – non-US spelling. Typos may cause reference errors.
fix
Use correct spelling: `normalise`.
affects: >=1.0.0
gotchaInput may contain leading/trailing whitespace; .trim() is not called internally.
fix
Trim input before calling functions: `normalise(rawABN.trim())`.
affects: >=1.0.0
gotchaThe `format` function expects a normalised (digits-only) string; unexpected results if given formatted string.
fix
Always normalise first: `format(normalise(input))`.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: normalise is not a function
Using `require('normalise-abn')` which returns the default export as an object? Actually import structure may differ; ensure correct import.
fix
Use ES import: `import { normalise } from 'normalise-abn'`
undefined method 'isValid'
Typo in function name (e.g., `isValid` vs `isvalid`).
fix
Check spelling: `isValid` with capital V.
Cannot find module 'normalise-abn'
Package not installed or typo in package name.
fix
Run `npm install normalise-abn` and verify package.json.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
normalise-abn — npm install normalise-abn · libregistry