Needs to convert complex string with car brand name or car model to slug. Also can convert cyrillic letters to latin.
# Install dependencies (only typescript needed)
$ npm i
# Generate JS if need
$ npm run build
# To see test cases try this:
$ node ./dist/test.js
import { CarSlugger } from "car-slugger";
const slugger = new CarSlugger();
console.log(slugger.translateCyrillic('Привет мир'));
// Output: "Privet mir"
This one is really poor
import { CarSlugger } from "car-slugger";
const slugger = new CarSlugger();
console.log(slugger.translateLatin('Transatlantic ocean'));
// Output: "Трансатлантик океан"
import { CarSlugger } from "car-slugger";
const slugger = new CarSlugger();
console.log(slugger.getSlug('LADA (ВАЗ) 2211 4x4'));
// Output: lada-vaz-2211-4x4
import { CarSlugger } from "car-slugger";
const slugger = new CarSlugger();
const dict = {
'1': 'one',
'2': 'two',
'3': 'three',
' ': ' ',
const string = slugger.translateCustom('3 3 2 1 1 3', dict);
// Output: "three three two one one three"
};