JavaScript library for Unicode normalization forms NFC, NFD, NFKC, and NFKD, compliant with Unicode 8.0. The package provides simple functions to normalize strings according to the Unicode Standard Annex #15. Version 1.6.0 is the latest stable release, last updated in 2019. It is a CommonJS module but also ships a browser bundle as a global. This library is a polyfill for String.prototype.normalize and is useful for text processing, internationalization, and ensuring consistent string comparison. Unlike the built-in normalizer (added in ES6), unorm works in older environments and offers fine-grained control. It has no external dependencies and is lightweight.
npm install unormVerified import paths — ran on the pinned version, not inferred.
Demonstrates all four Unicode normalization functions with a sample string.
Install @types/unorm from DefinitelyTyped or declare module 'unorm' in a .d.ts file.
Use built-in native normalize() if targeting Node.js >= 6 or modern browsers.
Include es5-shim before unorm for legacy browser support.
Use require() or configure bundler to handle CommonJS modules.
Include unorm via a <script> tag: <script src="node_modules/unorm/unorm.js"></script>, then use window.unorm.nfc()
Use named imports: import { nfc } from 'unorm'Add unorm to vite's optimizeDeps.include: ['unorm']
No dependency data recorded yet.