Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ts-shipment-tracking

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-shipment-tracking

Unified shipment tracking data from FedEx, UPS, and USPS APIs.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

ts-shipment-tracking

Unified shipment tracking data from FedEx, UPS, and USPS APIs.

Table of Contents
  1. About
  2. Installation
  3. Usage
  4. Built With
  5. Acknowledgements

About

Returns a unified TrackingInfo object for FedEx, UPS, and USPS tracking APIs. The structure is heavily inspired by the PHP tracking repo Shipment Tracking.

Installation

$ npm install delivery-tracker

Usage

Input:

import { trackFedex, trackUps, trackUsps } from '.';

(async (): Promise<void> => {
    try {
        const fedex = await trackFedex('<fedex-tracking-number>', {
            key: '<fedex-key>',
            password: '<fedex-password>',
            accountNumber: '<fedex-account-number>',
            meterNumber: '<fedex-meter-number>'
        });
        console.log(fedex);

        const ups = await trackUps('<ups-tracking-number>', {
            accessLicenseNumber: '<ups-access-license-number>'
        });
        console.log(ups);

        const usps = await trackUsps('<usps-tracking-number>', {
            userId: '<usps-user-id>'
        });
        console.log(usps);
    } catch (error) {
        console.log(error);
    }
})();

Output:

{
  events: [
    {
      status: 'IN_TRANSIT',
      label: 'Arrived at FedEx location',
      location: 'LEBANON TN US 37090',
      date: 1616823540000
    },
    ...
  ],
  estimatedDelivery: 1616996340000
}

Statuses:

    'UNAVAILABLE'
    'LABEL_CREATED'
    'IN_TRANSIT'
    'OUT_FOR_DELIVERY'
    'DELIVERY_ATTEMPTED'
    'RETURNED_TO_SENDER'
    'EXCEPTION'
    'DELIVERED'

Built With

Acknowledgements

Keywords

FAQs

Package last updated on 18 Aug 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc