novaposhta_3

0.3.2 • Public • Published

novaposhta 0.3.0

Instalation

You can add this package using following commands:

npm i novaposhta
yarn add novaposhta

Usage

Basic example:

import NovaPoshta from 'novaposhta';
 
const api = new NovaPoshta({ apiKey: '...' });
 
api.address.getCities({ Ref: "ebc0eda9-93ec-11e3-b441-0050568002cf" }).then((json) => {
    // do something
});

Winston Logger:

import NovaPoshta from 'novaposhta';
import Winston from 'winston';
import WinstonFormatter from 'winston-console-formatter';
 
const winstonLogger = new Winston.Logger({ level: "debug" });
winstonLogger.add(Winston.transports.Console, WinstonFormatter.config());
 
const api = new NovaPoshta({
    apiKey: '...',
    logger: winstonLogger,
});
 
api.address.getCities({ Ref: "ebc0eda9-93ec-11e3-b441-0050568002cf" }).then((json) => {
    // do something
});

Supported Methods

Address

const api = new NovaPoshta({ apiKey: '...' });
 
api.address.getCities({ Ref: "ebc0eda9-93ec-11e3-b441-0050568002cf" }).then((json) => {
    // do something
});

Common

const api = new NovaPoshta({ apiKey: '...' });
 
api.common.getTimeIntervals({ "RecipientCityRef": "8d5a980d-391c-11dd-90d9-001a92567626" }).then((json) => {
    // do something
});

Counterparty

const api = new NovaPoshta({ apiKey: '...' });
 
api.counterparty.getCounterpartyContactPerson({ ... }).then((json) => {
    // do something
});

Internet Document

const api = new NovaPoshta({ apiKey: '...' });
 
api.document.getDocumentList({ ... }).then((json) => {
    // do something
});

Contribute

What to help or have a suggestion? Open a new ticket and we can discuss it or submit pull request. Please, make sure you run npm test before submitting a pull request.

License

MIT

Package Sidebar

Install

npm i novaposhta_3

Weekly Downloads

1

Version

0.3.2

License

MIT

Unpacked Size

44.4 kB

Total Files

16

Last publish

Collaborators

  • teslov