normalize-diacritics
Remove accents/ diacritics in string
Last updated 11 days ago by motss .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install normalize-diacritics 
SYNC missed versions from official npm registry.

normalize-diacritics

Remove accents/ diacritics in string


Follow me

Version Node version MIT License

Downloads Total downloads Packagephobia Bundlephobia

CircleCI Dependency Status codecov Coverage Status

codebeat badge Codacy Badge Code of Conduct

Simple NPM package to remove any accents/ diacritics found in a string.

Table of contents

Pre-requisite

  • Node.js >= 10.18.1
  • NPM >= 6.13.4 (NPM comes with Node.js so there is no need to install separately.)

Install

# Install via NPM
$ npm install --save normalize-diacritics

Usage

TypeScript or ES Modules

import { normalize } from 'normalize-diacritics';

/** Assuming top-level await is enabled... */
await normalize('söme stüff with áccènts'); // 'some stuff with accents'

Node.js

const { normalize } = require('normalize-diacritics');

/** Assuming top-level await is enabled... */
await normalize('söme stüff with áccènts'); // 'some stuff with accents'

Browser

ES Modules

<script type="module">
  import { normalize } from 'https://unpkg.com/normalize-diacritics@latest/dist/normalize-diacritics.min.js';

  // --snip
</script>

UMD

<script src="https://unpkg.com/normalize-diacritics@latest/dist/normalize-diacritics.umd.min.js"></script>
<script>
  const { normalize } = window.NormalizeDiacritics;

  // --snip
</script>

Demo

Edit normalize-diacritics demo

deno

???? Check out the deno module at deno_mod/normalize_diacritics.

API Reference

normalize([input])

  • input <?string> Optional 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.

normalizeSync([input])

This methods works the same as normalize([input]) except that this is the synchronous version.

Contributing

Code of Conduct

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.

License

MIT License © Rong Sen Ng

Current Tags

  • 2.12.0                                ...           latest (11 days ago)
  • 2.11.1-rc.0                                ...           next (7 months ago)

34 Versions

  • 2.12.0                                ...           11 days ago
  • 2.11.1                                ...           7 months ago
  • 2.11.1-rc.0                                ...           7 months ago
  • 2.11.0                                ...           7 months ago
  • 2.10.0                                ...           7 months ago
  • 2.9.0                                ...           9 months ago
  • 2.8.0                                ...           a year ago
  • 2.7.0                                ...           a year ago
  • 2.6.1                                ...           a year ago
  • 2.5.0                                ...           a year ago
  • 2.4.0                                ...           a year ago
  • 2.3.0                                ...           a year ago
  • 2.2.3                                ...           a year ago
  • 2.2.2                                ...           a year ago
  • 2.2.1                                ...           2 years ago
  • 2.2.0                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.5.1                                ...           2 years ago
  • 0.4.4                                ...           3 years ago
  • 0.4.3                                ...           3 years ago
  • 0.4.2                                ...           3 years ago
  • 0.4.1                                ...           3 years ago
  • 0.4.0                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
  • 0.2.4                                ...           4 years ago
  • 0.2.3                                ...           4 years ago
  • 0.2.2                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.2                                ...           4 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 96
Last Day 0
Last Week 5
Last Month 11
Dependencies (0)
None
Dev Dependencies (14)

Copyright 2014 - 2016 © taobao.org |