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.3M
increased by4.06%
Maintainers
2
Install size
13.1 kB
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

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

Keywords

FAQs

Last updated on 08 Aug 2023

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