Socket
Socket
Sign inDemoInstall

remove-accents

Package Overview
Dependencies
0
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    remove-accents

Converting the accented characters to their corresponding non-accented ASCII characters.


Version published
Weekly downloads
3.5M
decreased by-1.26%
Maintainers
2
Created
Weekly downloads
 

Package description

What is remove-accents?

The remove-accents npm package is designed to help developers remove accents and diacritics from strings. This can be particularly useful for creating cleaner, ASCII-only versions of text that originally contains special characters from various languages. It's commonly used in applications that need to standardize user input, generate slugs for URLs, or simply ensure compatibility with systems that do not support such characters.

What are remove-accents's main functionalities?

Removing accents from a string

This feature allows you to remove all accents and diacritics from a given string, converting characters like 'À' to 'A', 'á' to 'a', etc. The code sample demonstrates how to use the package to convert a string containing various accented characters into its unaccented counterpart.

"use strict"; const removeAccents = require('remove-accents'); console.log(removeAccents('ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ'));

Other packages similar to remove-accents

Readme

Source

remove-accents

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

npm install remove-accents

Build Status Unit tests

About

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

Syntax

removeAccents(inputString)
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.

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

console.log(output); // AAAAAA

Methods

The exported function also has helper methods.

has

Determine if a string has any accented characters.

var accents = require('remove-accents');

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

Alias of removeAccents.

var accents = require('remove-accents');

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

License

MIT

Keywords

FAQs

Last updated on 24 Nov 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc