transliteration
Advanced tools
Comparing version 0.0.1 to 0.0.2
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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
309076