1.1.20 • Published 3 years ago
ts-shipment-tracking v1.1.20
About
Returns a unified response from FedEx, UPS, and USPS tracking APIs.
Installation
$ npm install ts-shipment-tracking
Usage
Courier API credentials are stored using dotenv. If you do not have dotenv installed:
$ npm install dotenv
Add the following credentials to your .env
file:
FEDEX_KEY=
FEDEX_PASSWORD=
FEDEX_ACCOUNT_NUMBER=
FEDEX_METER_NUMBER=
UPS_ACCESS_LICENSE_NUMBER=
USPS_USER_ID=
Example input:
import 'dotenv/config';
import { TrackingInfo, track, trackByCourier, trackFedex } from 'ts-shipment-tracking';
(async () => {
const exampleOne: TrackingInfo | undefined = await track('<any_tracking_number>');
console.log(exampleOne);
// or
const exampleTwo: TrackingInfo | undefined = await trackByCourier('ups', '<ups_tracking_number>');
console.log(exampleTwo);
// or
const exampleThree: TrackingInfo | undefined = await trackFedex('<fedex_tracking_number>');
console.log(exampleThree);
})();
Example output:
{
events: [
{
status: 'IN_TRANSIT',
label: 'Arrived at FedEx location',
location: 'LEBANON TN US 37090',
date: 1616823540000
},
...
],
estimatedDeliveryDate: 1616996340000
}
Statuses:
'UNAVAILABLE'
'LABEL_CREATED'
'IN_TRANSIT'
'OUT_FOR_DELIVERY'
'DELIVERY_ATTEMPTED'
'RETURNED_TO_SENDER'
'EXCEPTION'
'DELIVERED'
Built With
Acknowledgements
1.1.19
3 years ago
1.1.20
3 years ago
1.1.18
3 years ago
1.1.17
3 years ago
1.1.16
3 years ago
1.1.15
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.1.9
3 years ago
1.1.7
3 years ago
1.1.6
3 years ago
1.1.5
3 years ago
1.1.4
3 years ago
1.1.3
3 years ago
1.1.2
3 years ago
1.1.12
3 years ago
1.1.11
3 years ago
1.1.10
3 years ago
1.1.14
3 years ago
1.1.13
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago