universal-vin-decoder
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Universal VIN Decoder

universal-vin-decoder provides utility functions for validating and parsing Vehicle Identification Numbers (VIN).

  • Decode VINs from more than 1,500 manufacturers
  • Extract region, country, car model's year and manufacturer
  • Validate provided VIN

Usage

import { decodeVIN, splitVIN, validateVIN } from 'universal-vin-decoder';

validateVIN('VR7EFYHT2PN547380'); //=> { isValid: true }
validateVIN('hello there!'); //=> { isValid: false, error: 'VIN must be 17 characters long' }
validateVIN(null); //=> { isValid: false, error: 'VIN must be a string' }

splitVIN('NMTK33BXX0R132738');
//=> {
//     wmi: 'NMT',       World Manufacturer Identifier
//     vds: 'K33BXX',    Vehicle Descriptor Section
//     vis: '0R132738',  Vehicle Identifier Section
//     modelYear: '0',   Model Year
//   }

decodeVIN('VR7EFYHT2PN547380');
//=> {
//     vin: 'VR7EFYHT2PN547380',
//     isValid: true,
//     info: {
//       region: 'Europe',
//       country: 'France',
//       modelYear: '2023',
//       manufacturer: 'Citroën'
//     }
//   }

Installation

Use the package manager of your choice to install it throug the NPM registry. If you use npm run:

npm install universal-vin-decoder

Readme

Keywords

Package Sidebar

Install

npm i universal-vin-decoder

Weekly Downloads

14

Version

1.0.0

License

MIT

Unpacked Size

401 kB

Total Files

9

Last publish

Collaborators

  • mobito-srl