https://github.com/jhermsmeier/node-vehicle-identification-number
Vehicle Identification Number (VIN) parser & tools
https://github.com/jhermsmeier/node-vehicle-identification-number
car identification parser vehicle vehicle-identification-number vehicles vin
Last synced: 3 months ago
JSON representation
Vehicle Identification Number (VIN) parser & tools
- Host: GitHub
- URL: https://github.com/jhermsmeier/node-vehicle-identification-number
- Owner: jhermsmeier
- License: mit
- Created: 2016-10-04T12:16:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-04T12:16:22.000Z (over 8 years ago)
- Last Synced: 2025-01-08T06:48:41.581Z (4 months ago)
- Topics: car, identification, parser, vehicle, vehicle-identification-number, vehicles, vin
- Language: JavaScript
- Size: 8.79 KB
- Stars: 25
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Vehicle Identification Number (VIN)
[](https://npmjs.com/vehicle-identification-number)
[](https://npmjs.com/vehicle-identification-number)
[](https://npmjs.com/vehicle-identification-number)
[](https://travis-ci.org/jhermsmeier/node-vehicle-identification-number)## Install via [npm](https://npmjs.com)
```sh
$ npm install --save vehicle-identification-number
```## Usage
```js
var VIN = require( 'vehicle-identification-number' )
``````js
// German Porsche 993 GT2
var vin = VIN.parse( 'WP0ZZZ99ZTS392124' ) // OR
var vin = new VIN( 'WP0ZZZ99ZTS392124' )
``````js
> VIN {
region: 'EU',
country: 'DE',
assemblyPlant: 'S',
checksum: null,
modelYear: 'T',
serialNumber: '92124',
wmi: 'WP0',
vds: 'ZZZ99Z',
vis: 'TS392124'
}
``````js
// You can also only get parts relevant to you
VIN.getCountry( 'WP0ZZZ99ZTS392124' ) // -> 'DE'
VIN.getRegion( 'WP0ZZZ99ZTS392124' ) // -> 'EU'
VIN.getChecksum( 'WP0ZZZ99ZTS392124' ) // -> null (Europe does not use checksums)
VIN.hasValidChecksum( 'WP0ZZZ99ZTS392124' ) // -> trueVIN.getCountry( '1GNSCJKC9FR264648' ) // -> 'US'
VIN.getChecksum( '1GNSCJKC9FR264648' ) // -> '9'
VIN.hasValidChecksum( '1GNSCJKC9FR264648' ) // -> true
VIN.calculateChecksum( '1GNSCJKC9FR264648' ) // '9'
``````js
VIN.normalize( '1GN-SCJKC9-FR264648' ) // -> '1GNSCJKC9FR264648'
``````js
vin.toString() // -> 'WP0ZZZ99ZTS392124'
```