Important: This documentation applies to v2 of this package.
For v3 docs see vpic.shaggytech.com

Module

utils/isValidVin

Methods

# static isValidVin(vin) → {boolean}

Provides offline validation of Vehicle Identification Numbers (VINs) using the VIN Check Algorithm.

Parameters:
Name Type Description
vin string

Vehicle Identification Number.

View Source utils/isValidVin.ts, line 65

True for a valid VIN, false for an invalid VIN.

boolean
Examples

When loaded from the browser via html script tags

// <script type="text/javascript" src="https://www.npmjs.com/package/@shaggytools/nhtsa-api-wrapper"></script>
const isValid = NHTSA.isValidVin('3VWD07AJ5EM388202')
console.log(isValid) // true

When loaded as a module

import { isValidVin } from '@shaggytools/nhtsa-api-wrapper'
const isValid = isValidVin('3VWD07AJ5EM388202')
console.log(isValid) // true