Skip to content
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.
/ lookup_vehicle Public archive

A Simple node module to lookup a vehicle via a VIN number with nhtsa.dot.gov API

License

Notifications You must be signed in to change notification settings

ptariche/lookup_vehicle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lookup a Vehicle in the United States

A Simple Node Module to Lookup a vehicle via a VIN number with the nhtsa.dot.gov API

npm version

Install

Using npm:

$ npm install lookup_vehicle

functions

  • .lookup({String}, {AxiosConfig}) @return {promise} async function
  • .lookup_callback({String}, {Callback}) callback function
let LookupVehicle = require('lookup_vehicle');

Traditional Promise Method

LookupVehicle
  .lookup('vinnumber')
  .then( (result) => {
    console.log(result.data);
  });

Async-Await Method

let example = async () => {
  let vehicleInformation = await LookupVehicle.lookup('vinnumber');
  console.log(vehicleInformation.data);
  return;
};

Promise.resolve(example());

Tradational Callback Method

LookupVehicle.lookup_callback('vinnumber', (err, result) => {
  if (err) {
    console.log(err);
  } else {
    console.log(result);
  }
});

About

A Simple node module to lookup a vehicle via a VIN number with nhtsa.dot.gov API

Topics

Resources

License

Stars

Watchers

Forks

Packages