Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shevernitskiy/post-calculator
📦RussianPost calculator API client
https://github.com/shevernitskiy/post-calculator
api client deno javascript js node nodejs pochta post russianpost tariff ts typescript
Last synced: about 1 month ago
JSON representation
📦RussianPost calculator API client
- Host: GitHub
- URL: https://github.com/shevernitskiy/post-calculator
- Owner: shevernitskiy
- License: mit
- Created: 2024-07-26T05:17:01.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-26T13:30:02.000Z (4 months ago)
- Last Synced: 2024-09-29T18:41:03.650Z (about 2 months ago)
- Topics: api, client, deno, javascript, js, node, nodejs, pochta, post, russianpost, tariff, ts, typescript
- Language: TypeScript
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 📦RussianPost calculator API client
[![npm](https://img.shields.io/npm/v/@shevernitskiy/post-calculator?logo=npm&style=flat&labelColor=000)](https://www.npmjs.com/package/@shevernitskiy/post-calculator)
[![JSR](https://jsr.io/badges/@shevernitskiy/post-calculator)](https://jsr.io/@shevernitskiy/post-calculator)
![dependencies](https://img.shields.io/badge/dependencies-0-green?style=flat&labelColor=000)
[![license](https://img.shields.io/github/license/shevernitskiy/post-calculator?style=flat&labelColor=000)](https://github.com/shevernitskiy/post-calculator/blob/main/LICENSE)This is super simple typed API client for RussianPost Calculator API.
It just fetch calculator response from the API.# Installation
## Node.js
```sh
npm i @shevernitskiy/post-calculator
``````sh
npx jsr add @shevernitskiy/post-calculator
```## Deno
```sh
deno add @shevernitskiy/post-calculator
```# Usage
Call the `postCalculator` function with the required parameters (typed as well).
```ts
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.