3.0.1 • Published 5 years ago
ruplu v3.0.1
RuPlu
Russian words plural form helper
Склонение множественного числа существительных
Install
$ npm install ruplu --save
Usage
const ruplu = require('ruplu');
// OR
import ruplu from 'ruplu';
const cats = ruplu([
'кошка', // 1 кошка
'кошки', // 2 кошки
'кошек' // 5 кошек
]);
Just word
cats(1); // => 'кошка'
cats(3); // => 'кошки'
cats(6); // => 'кошек'
Word with count
cats(1, true); // => '1 кошка'
cats(3, true); // => '3 кошки'
cats(6, true); // => '6 кошек'
Word with count and custom delimiter
cats(1, true, ' '); // => '1 кошка'
cats(3, true, '_'); // => '3_кошки'
cats(6, true, '*'); // => '6*кошек'
Testing
$ npm install && npm test