Simple NPM package to remove any accents/ diacritics found in a string.
- Node.js >= 14.17.3
- NPM >= 6.14.13 (NPM comes with Node.js so there is no need to install separately.)
- ES Modules
# Install via NPM
$ npm i normalize-diacritics
import { normalize } from 'normalize-diacritics';
/** Assuming top-level await is enabled... */
await normalize('söme stüff with áccènts'); // 'some stuff with accents'
<script type="module">
import { normalize } from 'https://cdn.skypack.dev/normalize-diacritics@latest';
// --snip
</script>
👉 Check out the deno module at deno_mod/normalize_diacritics.
input
<string> Input string that contains accents/diacritics.- returns: <Promise<string>> Promise which resolves with normalized input string.
This method normalizes any accents/ diacritics found in a given input string and output a normalized string as a result.
This methods works the same as normalize([input])
except that this is the synchronous version.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
MIT License © Rong Sen Ng