This little module allows the removal of any accent from each character in a string text. It also converts special UTF-8 characters to the visually closest character.
é => e
œ => oe
ȸ => db
ß => ss // in the german language, those are interchangeable
Script:
const removeAccents = require('remove-accents')
const withAccent = 'exposé'
const withoutAccent = removeAccents(withAccent)
console.log(withoutAccent)
Output:
expose
Script:
import removeAccents from 'remove-accents'
const withAccent = 'exposé'
const withoutAccent = removeAccents(withAccent)
console.log(withoutAccent)
Output:
expose