@shevernitskiy/post-calculator
v0.1.3
Published
RussianPost calculator API client
Downloads
8
Maintainers
Readme
📦RussianPost calculator API client
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.