Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

transliteration

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

transliteration - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

10

lib/transliteration.js
var punycode = require('punycode');
module.exports = {
transliteration = {
transliterate: function(str, unknown) {

@@ -14,3 +15,3 @@ var codemap = {};

if(typeof codemap[bank] === 'undefined') {
var filename = './data/x' + bank.toString(16) + '.js';
var filename = '../data/x' + bank.toString(16) + '.js';
try {

@@ -43,3 +44,3 @@ codemap[bank] = require(filename);

if(typeof lowercase === 'undefined') lowercase = true;
var slug = this.transliterate(str).replace(/[^a-zA-Z0-9]+/g, options.separator);
var slug = transliteration.transliterate(str).replace(/[^a-zA-Z0-9]+/g, options.separator);
if(options.lowercase) {

@@ -54,3 +55,2 @@ slug = slug.toLowerCase();

}
console.log(module.exports.slugify('λόγος你好,这个不错,hello, this is not bad'));
module.exports = transliteration;
{
"name": "transliteration",
"version": "0.0.1",
"version": "0.0.2",
"description": "Transliteration module for node.js. Transliterate unicode characters into latin ones. Supports all common unicode characters including CJK.",

@@ -5,0 +5,0 @@ "main": "lib/transliteration.js",

@@ -13,3 +13,3 @@ # Transliteration

var transliteration = require('transliteration');
transliteration.transliterate('你好,世界'); // Ni Hao, Shi Jie
transliteration.transliterate('你好,世界'); // Ni Hao ,Shi Jie
```

@@ -16,0 +16,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc