shevchenko-ext-military
TypeScript icon, indicating that this package has built-in type declarations

0.0.0-beta.1 • Public • Published

shevchenko.js military extension

shevchenko.js extension for declension of Ukrainian military ranks and appointments.

User Guide

Installation

npm

To install the library using npm package manager, use the following command:

npm install --save shevchenko@^3.1.0 shevchenko-ext-military

Import

The extension comes in two formats: CommonJS module and ECMAScript module. You can select the format that best suits your needs.

CommonJS

To import the extension as a CommonJS module, use the following code:

const { militaryExtension } = require('shevchenko-ext-military');

ECMAScript

To import the extension as an ECMAScript module, use the following code:

import { militaryExtension } from 'shevchenko-ext-military';

Use Cases

Military rank and appointment declension

const shevchenko = require('shevchenko');
const { militaryExtension } = require('shevchenko-ext-military');

shevchenko.registerExtension(militaryExtension);

async function main() {
  const input = {
    gender: 'masculine',
    militaryRank: 'солдат',
    militaryAppointment: 'помічник гранатометника',
    familyName: 'Шевченко',
    givenName: 'Тарас',
    patronymicName: 'Григорович',
  };

  const output = await shevchenko.inGenitive(input);

  console.log(output); // { militaryRank: "солдата", militaryAppointment: "помічника гранатометника", familyName: "Шевченка", givenName: "Тараса", patronymicName: "Григоровича" }
}

main().catch((error) => console.error(error));

Dependents (0)

Package Sidebar

Install

npm i shevchenko-ext-military

Weekly Downloads

2

Version

0.0.0-beta.1

License

MIT

Unpacked Size

18.4 kB

Total Files

17

Last publish

Collaborators

  • tooleks