remove-accents
Converting the accented characters to their corresponding non-accented ASCII characters.
Last updated 3 years ago by tyxla .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install remove-accents 
SYNC missed versions from official npm registry.

remove-accents

Removes the accents from a string, converting them to their corresponding non-accented ASCII characters.

npm install remove-accents

Unit tests

About

An easy to use solution for converting all accented characters to their corresponding non-accented ASCII characters.

Syntax

import removeAccents from 'remove-accents';

removeAccents(inputString)

Alternatively, you could use the CommonJS syntax to import it:

const removeAccents = require('remove-accents');

inputString

The string that you wish to remove accents from.

Usage

Call removeAccents() by passing the string you wish to remove accents from, and you will get the non-accented string as result.

const input = 'ÀÁÂÃÄÅ';
const output = removeAccents(input);

console.log(output); // AAAAAA

Methods

The exported function also has helper methods.

has

Determine if a string has any accented characters.

import removeAccents from 'remove-accents';

console.log(removeAccents.has('ÀÁÂÃÄÅ')); // true
console.log(removeAccents.has('ABC'));    // false

remove

Alias of removeAccents.

import removeAccents from 'remove-accents';

console.log(removeAccents.remove('ÀÁÂÃÄÅ')); // AAAAAA

License

MIT

Current Tags

  • 0.5.0                                ...           latest (3 years ago)

9 Versions

  • 0.5.0                                ...           3 years ago
  • 0.4.4                                ...           3 years ago
  • 0.4.3                                ...           4 years ago
  • 0.4.2                                ...           8 years ago
  • 0.4.1                                ...           9 years ago
  • 0.4.0                                ...           9 years ago
  • 0.3.0                                ...           10 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |