1.1.5 • Published 3 years ago

novaposhtajs v1.1.5

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

novaposhtajs

npm version

novaposhtajs is a TypeScript SDK for the NovaPoshta API. This library provides a simple, efficient, and flexible way to interact with the NovaPoshta API using JavaScript/TypeScript. The naming style for models and arguments has been changed to lower camel case, making the library more consistent with JavaScript style conventions.

Features

  • Full coverage of NovaPoshta API endpoints
  • TypeScript support with type definitions
  • Promisified methods for easy async/await usage
  • Automatic request retries with customizable settings
  • Lower camel case naming convention for models and arguments

Installation

Use the package manager npm to install novaposhtajs:

npm install novaposhtajs

Usage

Here's a simple example of how to use the library:

const { NovaPoshta, initNovaPoshta } = require('novaposhtajs');

const apiKey = 'your-api-key';
const novaPoshta: NovaPoshta = initNovaPoshta(apiKey);

// Get a list of cities
novaPoshta.address.getCities({ page: 1, limit: 10 })
  .then(cities => console.log(cities))
  .catch(error => console.error(error));

Export any response type

const { AddressGetAreasResponse, initNovaPoshta } = require('novaposhtajs');

function anyActionWithArea(area: AddressGetAreasResponse) {
    console.log(area.ref, area.description);
}

const novaPoshta = initNovaPoshta();
const areas = await novaPoshta.address.getAreas({});
areas.map(area => anyActionWithArea(area))

License

MIT

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago