Skip to content

npm package for remove diacritics/accents in the given string

License

Notifications You must be signed in to change notification settings

tsl143/escape-diacritics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

escape-diacritics

escape-diacritics remove diacritics/accents in the given string.

escape-diacritics results a diacritics free string eg. Québec will be returned as Quebec, this helps generally in uniform string search.

Requirements

escape-diacritics has no production dependency, there are few dev dependencies for test and build purpose

How to use

Browser

  • Clone repository
  • Run npm install and build / minify:
npm install
npm run minify

You'll find the minified and unminified versions of escape-diacritics in the dist/ directory.

Use it in the browser:

<html>
    <body>
        <h1>Hello World!</h1>
        <script type="text/javascript"  src="dist/escape-diacritics.js"></script>
        <script type="text/javascript" src="index.js"></script>
    </body>
</html>
var str = "Québec";
console.log(removeDiacritics(str));

Node

Install module from console:

npm install escape-diacritics

Use it in your node app:

var removeDiacritics = require('escape-diacritics');

var withDiacritics = 'Québec';
var withoutDiacritics = removeDiacritics(withDiacritics);

About escape-diacritics

escape-diacritics was created by Trishul. I needed this functionality in one of my project, and I have to write this code, so why not make it opensource and let others too get benefit from it :), Vist my github for more project and few webextenions.

Support

Feel free to open issues on github.

About

npm package for remove diacritics/accents in the given string

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published