beaufort-scale
Translate speed to Beaufort wind force scale in both Node and the Browser. Returns the Beaufort Scale intensity grade number from a given wind speed (in Kilometres per hour).
Install and Include the module
-
Node
$ npm install beaufort-scalevar beaufort = -
or Browser
Clone the repo or download the minified file : beaufort-scale.min.js
$ git clone https://github.com/alterebro/beaufort-scale.git
Usage
// returns an object grade: 609 desc: "Strong breeze"
Options
There are two options that can be sent to the beaufort function. These are optional and have to be passed as an Object.
- lang :
String
orArray
the language of the description string ( desc ). As a string there are two possible values, en for English or es for Spanish, the default value is en.
As an array you can add your own language string values - int :
Boolean
determines if the grade returns an integer or a floating number, default value is false.
Example
// returns the following object grade: 6 desc: "Brisa fuerte"
With an array of values as a lang
parameter, for example with the greek strings as provided by @groubis
; // returns the object: grade: 0 desc: "Άπνοια"
Build
$ npm run build# or alternatively just: $ gulp
Tests
$ npm test$ npm run cov # with test coverage