pico-placa
v1.0.3
Published
Pico y placa predictor
Downloads
2
Readme
Pico y Placa Predictor
A custom CLI to predict Quito's Pico y Placa restrictions. It was done with Typescript to implement and practice DDD best practices.
A car that is restricted from circulation must meet all the following criteria:
- The last digit of its licence plate is:
- Monday: 1,2.
- Tuesday: 3,4.
- Wendnesday: 5,6.
- Thursday: 7,8.
- Friday: 9,0.
- Saturday: No restrictions.
- Sunday: No restrictions.
- The circulation time matches time from 7:00 to 9:30 and from 16:00 to 19:30.
Requirements
Node >=8.0.0
Instalation
Option 1: npx installation
$ npx pico-placa
Option 2: npm global installation
$ npm i -g pico-placa
Usage
To predict if the car can be on the road or not the CLI will ask for the car's licence plate, and the date and time of circulation.
Option 1: Execute command with flags
$ pico-placa --plate ABG-8234 --date 2020-05-04 --time 20:45
Opction2: Execute command without flags
$ pico-placa
The following questions will be prompted.
Results
Results will be shown in a red background if the car can't be on the road or in a green background if the car can be on the road.
To run tests
- Clone or fork project from Github
$ npm install
$ npm test
To run project from code
- Clone or fork project from Github
$ npm install
$ ./bin/run