All Projects → niradler → tracking-number-validation

niradler / tracking-number-validation

Licence: other
A simple way to validate tracking number for the following couriers.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to tracking-number-validation

php-tracking-urls
Converts package tracking numbers into URLs (UPS, FedEx, USPS, and more)
Stars: ✭ 47 (+113.64%)
Mutual labels:  ups, fedex, usps
shippo-csharp-client
Shipping API C# library (USPS, FedEx, UPS and more)
Stars: ✭ 52 (+136.36%)
Mutual labels:  ups, fedex, usps
ShippingRates
.NET wrapper to UPS, FedEx, USPS and DHL shipping rates APIs
Stars: ✭ 23 (+4.55%)
Mutual labels:  ups, fedex, usps
utility-scripts-for-freenas-and-vmware-esxi
All-In-One utility scripts for FreeNAS and VMware ESXi
Stars: ✭ 59 (+168.18%)
Mutual labels:  ups
jackrabbit
Simple AMQP / RabbitMQ job queues for node based on amqplib
Stars: ✭ 28 (+27.27%)
Mutual labels:  nodejs-modules
vayder
Easy and concise validations for Express routes
Stars: ✭ 26 (+18.18%)
Mutual labels:  nodejs-modules
generate-package-json-webpack-plugin
Generates a package.json file containing the external modules used by your webpack bundle
Stars: ✭ 59 (+168.18%)
Mutual labels:  nodejs-modules
ups-telegraf
Get data from USB-connected UPS with Telegraf
Stars: ✭ 21 (-4.55%)
Mutual labels:  ups
node-screenlogic
Pentair ScreenLogic Javascript library using Node.JS
Stars: ✭ 38 (+72.73%)
Mutual labels:  nodejs-modules
arcscord
A Discord library written in typescript
Stars: ✭ 18 (-18.18%)
Mutual labels:  nodejs-modules
fastify-axios
Add axios http client to your fastify instance
Stars: ✭ 28 (+27.27%)
Mutual labels:  nodejs-modules
weiboer
基于nodejs 和puppeteer的微博自动发送工具
Stars: ✭ 27 (+22.73%)
Mutual labels:  nodejs-modules
nodejs-onesky-utils
Node.js utils for working with OneSky translation service.
Stars: ✭ 32 (+45.45%)
Mutual labels:  nodejs-modules
ATtiny13-TinyUPS
Uninterruptible Power Supply
Stars: ✭ 92 (+318.18%)
Mutual labels:  ups
ballotnav
A repository for HackforLA's BallotNav project
Stars: ✭ 21 (-4.55%)
Mutual labels:  usps
usps-api
Python Wrapper for the USPS API 🚚 📦
Stars: ✭ 52 (+136.36%)
Mutual labels:  usps
web-ext-deploy
A tool for deploying WebExtensions to multiple stores.
Stars: ✭ 28 (+27.27%)
Mutual labels:  nodejs-modules
napi-thread-safe-callback
C++ utility class to perform callbacks into JavaScript from any thread
Stars: ✭ 62 (+181.82%)
Mutual labels:  nodejs-modules
roulier
API for package delivery
Stars: ✭ 18 (-18.18%)
Mutual labels:  ups
node-opcda
Node.js package to access OPC Da 2.0 for reading and writing. Welcome your PLC JavaScript overlords. Better yet, program them!
Stars: ✭ 30 (+36.36%)
Mutual labels:  nodejs-modules

tracking-number-validation

A simple way to validate tracking number for the following couriers.

supported couriers:

  • ups
  • usps
  • dhl
  • fedex
  • ontrac

Updates

v2 api changes. checkout out v1 and v2 branches.

v2 api:

  • getCourier(tracking) -> Array: [courier] //due to the similarity some times there is a match for more then 1 courier
  • getCourierOne: (tracking,courier) -> String: courier //not safe
  • isValid: (tracking) -> Boolean: true/false //return true if match one or more couriers
  • isCourier: (tracking,courier) -> Boolean: true/false
  • getTrackingUrl: (tracking,courier) -> String: url for tracking number.

Usage

v1 api:

Nodejs:

  • npm i tracking-number-validation --save
  • const tnv = require('tracking-number-validation')
  • tnv.getCourier('1Z2869Y60397722027') -> return courier like ups
  • tnv.isValid('1Z2869Y60397722027','fedex') -> return true/false

Javascript:

  • npm i tracking-number-validation --save
  • include main.js in your index.html
<script src="node_modules/tracking-number-validation/dist/main.js"></script>
  • const courier = TNV.getCourier(tr)

Demo

link

Tested Against

UPS:

  • "1Z9999W99999999999": "ups",
  • "1Z12345E1512345676": "ups",
  • "1Z12345E0205271688": "ups",
  • "1Z12345E6605272234": "ups",
  • "1Z12345E0305271640": "ups",
  • "1Z12345E0393657226": "ups",
  • "1Z12345E1305277940": "ups",
  • "1Z12345E6205277936": "ups",
  • "1Z12345E1505270452": "ups",
  • "1Z648616E192760718": "ups",
  • "1ZWX0692YP40636269": "ups",
  • T9999999999: "ups",

FEDEX:

  • "9999 9999 9999": "fedex",
  • "9999 9999 9999 999": "fedex",
  • "999999999999": "fedex",
  • "999999999999999": "fedex",
  • "661377569221": "fedex",
  • "624893691092": "fedex",
  • "61299995669352455464": "fedex",
  • "61299995669151880177": "fedex",

USPS:

  • "9400 1000 0000 0000 0000 00": "usps",
  • "9205 5000 0000 0000 0000 00": "usps",
  • "9407 3000 0000 0000 0000 00": "usps",
  • "9303 3000 0000 0000 0000 00": "usps",
  • "82 000 000 00": "usps",
  • "EC 000 000 000 US": "usps",
  • "9270 1000 0000 0000 0000 00": "usps",
  • "EA 000 000 000 US": "usps",
  • "CP 000 000 000 US": "usps",
  • "9208 8000 0000 0000 0000 00": "usps",
  • "9202 1000 0000 0000 0000 00": "usps",
  • "9400100000000000000000": "usps",
  • "9205500000000000000000": "usps",
  • "9407300000000000000000": "usps",
  • "9303300000000000000000": "usps",
  • "8200000000": "usps",
  • EC000000000US: "usps",
  • "9270100000000000000000": "usps",
  • EA000000000US: "usps",
  • CP000000000US: "usps",
  • "9208800000000000000000": "usps",
  • "9202100000000000000000": "usps",
  • "92748963438592543475924253": "usps",

ONTRAC:

  • C00000000000000: "ontrac",
  • C99999999999999: "ontrac",

DHL:

  • "125-12345678": "dhl",
  • "125 12345678": "dhl",
  • "12512345678": "dhl",
  • SEA1234567: "dhl",
  • LAX1234567: "dhl",
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].