Registry / productivity / normalise-acn

normalise-acn

JSON →
library1.0.0jsnpmunverified

Australian Company Number (ACN) normaliser and formatter. Current stable version 1.0.0, single release to date. Provides functions to validate, normalise (strip spaces/formatting), extract ACN from mixed strings, and format with standard spacing. Lightweight, no dependencies, ESM and CJS compatible, TypeScript type declarations included.

npm install normalise-acn
INSTALL
IMPORT
SIG · NORMALISE-ACN
N
normalise-acn
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.

isValidACN
import { isValidACN } from 'normalise-acn'
const { isValidACN } = require('normalise-acn')
Package supports both ESM and CommonJS. Use default import for CommonJS if needed.
normaliseACN
import { normaliseACN } from 'normalise-acn'
import { normaliseAcn } from 'normalise-acn'
Function name uses camelCase, not all lowercase.
formatACN
import { formatACN } from 'normalise-acn'
import { formatAcn } from 'normalise-acn'
Case-sensitive export.

Demonstrates validation, normalisation, formatting, and extraction of an Australian Company Number.

import { isValidACN, normaliseACN, formatACN, extractACN } from 'normalise-acn'; // Validate an ACN console.log(isValidACN('123 456 789')); // true or false // Normalise: remove spaces and dashes console.log(normaliseACN('123 456 789')); // '123456789' // Format with standard spacing (XXX XXX XXX) console.log(formatACN('123456789')); // '123 456 789' // Extract ACN from larger string console.log(extractACN('ACN: 123 456 789')); // '123456789'
Debug
Known issues
gotchaCase sensitivity of function exports: use exact camelCase names (e.g., 'normaliseACN', not 'normaliseAcn').
fix
Ensure correct casing when importing.
affects: >=1.0.0
gotchaInput may contain leading/trailing whitespace or symbols; normaliseACN strips non-digit characters except for internal spaces/dashes that are removed.
fix
Pre-process input if necessary.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: (0 , normalise_1.isValidACN) is not a function
Named import incorrectly used when default import expected (or vice versa) in CommonJS environment.
fix
Use `const { isValidACN } = require('normalise-acn')` or switch to ESM import syntax.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
normalise-acn — npm install normalise-acn · libregistry