0.2.2 • Published 9 years ago

vehicle-restriction v0.2.2

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

node-vehicle-restriction

NPM version

calc vehicle restriction rule


Installation

$ npm install vehicle-restriction

Feature

  • 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));
// ==> true

Usage

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 F8965 or 浙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

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago