Skip to content

Commit

Permalink
fix: initialization of the constructor was missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Tougrel authored Mar 23, 2022
1 parent 5920679 commit e2072c6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,27 @@ Node.js module that interfaces with Greek courier companies.

## Install

> `npm i courier-api`or `yarn add courier-api`
Using npm
- `npm install courier-api`

Using yarn
- `yarn add courier-api`

## Usage example

```js
const DHL = new (require("courier-api").speedex);
const DHL = new (require("courier-api").DHL);
// or
const {DHL} = require("courier-api");
// It's the same for the other supported couriers

DHL.get("TRACK_ID").then((response) => {
const courier = new DHL();
courier.get("TRACK_ID").then((response) => {
/* your code here */
}).catch(console.error);
// or
(async () => {
const data = await DHL.get("TRACK_ID");
const data = await courier.get("TRACK_ID");
/* your code here */
})();

Expand Down

0 comments on commit e2072c6

Please sign in to comment.