traffic-fine-calculator
Version:
A leightweight JavaScript traffic fine calculator
75 lines (54 loc) • 1.63 kB
Markdown
# traffic-fine-calculator
By [Oceanhouse21](http://www.oceanhouse21.com)
[](https://travis-ci.org/oceanhouse21/traffic-fine-calculator)
A leightweight traffic fine calculator for JavaScript. Currently only German law is supported.
## USAGE
```javascript
var traffic-fine-calculator = require('traffic-fine-calculator')
// Arguments depend on type of traffic fine
// Example for speeding, speed is in km/h
var result = traffic-fine-calculator(type: 'speeding', speed: 50, in_town: false)
// 'result: "3 Punkte und Geld- oder Freiheitsstrafe und Führerscheinentrzug"'
```
## ARGUMENTS
Example usage for different types
### Speeding
```javascript
traffic-fine-calculator({
type: 'speeding',
speed: 50,
in_town: false //out of town
});
```
### Distance
```javascript
traffic-fine-calculator({
type: 'distance',
speed: 50,
distance: 0.1, // less than 1/10 of half of the speedometer
thread: true,
damage: true
});
```
### Alcohol
```javascript
traffic-fine-calculator({
type: 'alcohol',
permille: 50,
entries: 3,
probation: true,
thread: false
});
```
### Traffic light
```javascript
traffic-fine-calculator({
type: 'traffic_light',
more_than_one_sec: true,
thread: true,
damage: false
});
```
## LICENSE
[MIT License](http://opensource.org/licenses/MIT). Copyright 2014-2015 Oceanhouse21 GmbH. http://www.oceanhouse21.com
You are not granted rights or licenses to the trademarks of Oceanhouse21 GmbH, including without limitation the traffic-fine-calculator name.