🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

emspost

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emspost

NodeJS EMS Post API

latest
Source
npmnpm
Version
0.0.8
Version published
Maintainers
1
Created
Source

emspost

This is a NodeJS library for EMS Russian Post API. Get more about the API.

Install

npm install emspost --save

Example

var emspost = require('emspost');
emspost.echo().then(function (result) {
    if (result) {
        console.log('service is available');
    } else {
        console.log('service isn\'t available');
    }
}).catch(function (error) {
    console.log('something went wrong...');
})

API Methods

Get countries

Example:

emspost.getCountries().then(function (result) {
    console.log(result);
})

Result:

[
    ...
    {name: 'РОССИЯ', code: 'RU'},
    ...
]

Get regions

Example:

emspost.getRegions().then(function (result) {
    console.log("getRegions", result);
})

Result:

[
    ...
    {name: 'АДЫГЕЯ РЕСПУБЛИКА', code: 'region--respublika-adygeja'},
    ...
]

Get cities

Example:

emspost.getCities().then(function (result) {
    console.log("getCities", result);
})

Result:

[
    ...
    {name: 'АБАКАН', code: 'city--abakan'},
    ...
]

Get max weight

Example:

emspost.getMaxWeight().then(function (result) {
    console.log("getMaxWeight", result);
})

Calculate delivery price

Method has one argument CalculateProperty that contains the following properties (see more about these properties):

{
    from?:string, 
    to:string, 
    weight:number,
    type:string
}

Example:

emspost.calculate({from: "city--moskva", to: "city--murmansk", weight: 1})
    .then(function (result) {
        console.log('calculate', result);
    })

Result:

{
    price: 680,
    period: {
        max: 3,
        min: 2
    }
}

Keywords

ems

FAQs

Package last updated on 17 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts