Port of PHP Vocative library for NodeJS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
__tests__
data
dist
lib
.gitignore
.travis.yml
LICENSE
README.md
index.ts
jest.config.js
package.json
tsconfig.json
webpack.config.js
yarn.lock

README.md

Vokativ JS

Build Status NPM version

Acknowledgements

This is a JavaScript port of PHP Vocative case library for Serbian language written by Nemanja Avramovic.

Original idea and PHP implementation can be found at Vokativ.

Installation

npm install vokativ-js

Optionally you can add --save flag to update package.json dependency list

Usage

As promise

var Vocative = require('vokativ-js').Vocative;

var v = new Vokativ();
v.make('Vuk')
    .then((vocative) => {
        console.log(vocative);
    });

With async/await

var Vokativ = require('vokativ-js').Vocative;

async function demo () {
    var v = new Vokativ();
    let name = await v.make('Vuk');
    console.log(name);    
}

demo();

With Typescript

import { Vocative } from "vokativ-js";

let v = new Vocative();

v.make('Vuk')
    .then((vocative) => {
        console.log(vocative);
    });

Note:

Due to significant similarity, this library should also work just fine with former Yugoslav languages such as Croatian, Bosnian, Montenegrin, but if there are any rules that were missed feel free to contact me or make a pull request.