0.1.3 • Published 12 months ago

@shevernitskiy/post-calculator v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

📦RussianPost calculator API client

npm JSR dependencies license

This is super simple typed API client for RussianPost Calculator API. It just fetch calculator response from the API.

Installation

Node.js

npm i @shevernitskiy/post-calculator
npx jsr add @shevernitskiy/post-calculator

Deno

deno add @shevernitskiy/post-calculator

Usage

Call the postCalculator function with the required parameters (typed as well).

import { postCalculator } from "@shevernitskiy/post-calculator";

const result = await postCalculator({
  object: 27030,
  from: 115211,
  to: 620000,
  weight: 1000,
});

// result will be typeof PostCalcResponse (typed json)

const result2 = await postCalculator({
  format: "html",
  object: 27030,
  from: 115211,
  to: 620000,
  weight: 1000,
});

// result2 will be typeof string

Contribution

Pull request, issues and feedback are very welcome. Code style is formatted with deno fmt.

License

Copyright 2024, shevernitskiy. MIT license.

0.1.3

12 months ago

0.1.2

12 months ago

0.1.1

12 months ago