Unicode transliteration utilities for Node.js: remove diacritics, normalize, etc.
This code is licensed under the terms of the MIT license (see LICENSE.md).
Full documentation is available on GitHub pages.
Add to your project
Install from NPM:
npm install --save smtransliterator
Include the module with:
const SMTransliterator =
The module exports the following methods:
This method removes all diacritics from latin characters in the
str parameter. For example, the string papà (Italian for "dad") is converted to papa, or the famous DJ Tiësto has the umlaut removed from his name (to "Tiesto"). Case is always preserved, and the method is safe to use with strings containing non-latin characters too.
Additionally, the resulting Unicode string is canonicalized in the NFC form.
full is true (default is false), it also removes punctuation characters and those in the "Other" Unicode plane (which includes control characters, unassigned ones, etc).
Short-hand method that calls the
SMTransliterator.Transliterate method, and additionally lowercases the resulting string. Parameters are the same as in the