{"id":18900,"library":"unorm","title":"unorm","description":"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.","status":"maintenance","version":"1.6.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/walling/unorm","tags":["javascript"],"install":[{"cmd":"npm install unorm","lang":"bash","label":"npm"},{"cmd":"yarn add unorm","lang":"bash","label":"yarn"},{"cmd":"pnpm add unorm","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"unorm is primarily CommonJS but can be imported via ESM if using bundler. The package does not ship TypeScript types.","wrong":"const unorm = require('unorm'); unorm.nfc()","symbol":"nfc","correct":"import { nfc } from 'unorm'"},{"note":"Default import from unorm is not defined; use named imports.","wrong":"import unorm from 'unorm'; unorm.nfd()","symbol":"nfd","correct":"import { nfd } from 'unorm'"},{"note":"Same pattern as nfc/nfd.","wrong":null,"symbol":"nfkc","correct":"import { nfkc } from 'unorm'"},{"note":"Same pattern.","wrong":null,"symbol":"nfkd","correct":"import { nfkd } from 'unorm'"}],"quickstart":{"code":"import { nfc, nfd, nfkc, nfkd } from 'unorm';\n\nconst text = '\\u212B\\u00C5ngstr\\u00F6m';\nconsole.log('NFC:', nfc(text));\nconsole.log('NFD:', nfd(text));\nconsole.log('NFKC:', nfkc(text));\nconsole.log('NFKD:', nfkd(text));","lang":"javascript","description":"Demonstrates all four Unicode normalization functions with a sample string."},"warnings":[{"fix":"Install @types/unorm from DefinitelyTyped or declare module 'unorm' in a .d.ts file.","message":"unorm does not ship TypeScript type definitions; users must create their own or use @types/unorm (community-maintained).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use built-in native normalize() if targeting Node.js >= 6 or modern browsers.","message":"String.prototype.normalize is available in Node.js >= 6 and modern browsers; unorm is only needed for polyfilling older environments.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Include es5-shim before unorm for legacy browser support.","message":"The package uses ECMAScript 5 features; older browsers (IE8 and below) require es5-shim.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use require() or configure bundler to handle CommonJS modules.","message":"unorm uses CommonJS module exports; direct ESM imports may fail in some bundlers without proper configuration.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.6.0':33 '15':31 '2019':42 '8.0':16 'accord':25 'ad':82 'also':49 'annex':30 'browser':52 'built':79 'built-in':78 'bundl':53 'commonj':46 'comparison':75 'compliant':13 'consist':73 'control':95 'depend':100 'ensur':72 'environ':89 'es6':84 'extern':99 'fine':93 'fine-grain':92 'form':7 'function':21 'global':56 'grain':94 'internation':70 'javascript':2,104 'last':39 'latest':36 'librari':3,58 'lightweight':103 'modul':47 'nfc':8 'nfd':9 'nfkc':10 'nfkd':12 'normal':6,23,81 'offer':91 'older':88 'packag':18 'polyfil':61 'process':69 'provid':19 'releas':38 'ship':50 'simpl':20 'stabl':37 'standard':29 'string':24,74 'string.prototype.normalize':63 'text':68 'unicod':5,15,28 'unlik':76 'unorm':1,85 'updat':40 'use':66 'version':32 'work':86","created_at":"2026-04-25T07:40:43.650811+00:00","updated_at":"2026-04-25T07:40:43.650811+00:00","problems":[{"fix":"Include unorm via a <script> tag: <script src=\"node_modules/unorm/unorm.js\"></script>, then use window.unorm.nfc()","cause":"Using unorm in a browser without a bundler or script tag.","error":"require is not defined"},{"fix":"Use named imports: import { nfc } from 'unorm'","cause":"Incorrect import (e.g., default import) when using ESM.","error":"TypeError: unorm.nfc is not a function"},{"fix":"Add unorm to vite's optimizeDeps.include: ['unorm']","cause":"Using Vite or similar bundler that treats CommonJS modules as external.","error":"Module \"unorm\" has been externalized for browser compatibility and cannot be accessed"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/walling/unorm","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/unorm","openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}