0.1.3 • Published 2 years ago
@shevernitskiy/post-calculator v0.1.3
📦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-calculatornpx jsr add @shevernitskiy/post-calculatorDeno
deno add @shevernitskiy/post-calculatorUsage
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 stringContribution
Pull request, issues and feedback are very welcome. Code style is formatted with deno fmt.
License
Copyright 2024, shevernitskiy. MIT license.