0.2.2 • Published 10 years ago
vehicle-restriction v0.2.2
node-vehicle-restriction
calc vehicle restriction rule
Installation
$ npm install vehicle-restrictionFeature
- noremalize plate string
- test if the vehicle' plate is restricted
- show which plate number is restricted
- support more city
Example
const vr = require('vehicle-restriction');
console.log(vr.hz.isRestricted('浙A·F8965', 5));
// ==> trueUsage
Currently, it's only support hangzhou
Namespace
All methods is associated with city by a namespace, and the namespace is the city's name in Pinyin, or shorted letters.
eg: if the module was required as vr, Hangzhou will be vr.hz or vr.hangzhou.
APIs
.isRestricted(plate, day)
Params:
plate: String of the vehicle's plate, supported format:浙A·F8965,浙A-F8965,浙A F8965or浙AF8965.day<Number | String>: Day number in a week, 0 for Sunday, 1 for Monday, etc.
Return:
: true: is restricted; false: is not restricted.
License
MIT © Leigh Zhu