lookup_vehicle

1.0.1 • Public • Published

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);
  }
});

Package Sidebar

Install

npm i lookup_vehicle

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

5.79 kB

Total Files

7

Last publish

Collaborators

  • ptariche