escape-diacritics v1.1.1
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 minifyYou'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-diacriticsUse 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.
8 years ago