@marzzelo/windir

1.2.3 • Public • Published

Wind Direction

Converts wind direction in degrees to cardinal points.

  • Selectable intervals 4, 8 or 16 cardinal points.
  • Selectable languages (es, en)
  • Selectable mode:
    • full cp names (East, West...)
    • cp symbols (E, W, ...)

Install

From npm:

npm install marzzelo/windir

Usage

const { windir } = require('./windir');

// Default options (english, short format, 16 cardinal points):
const WIND_BEARING = '150';
console.log(`Wind direction: ${windir(WIND_BEARING)}`); // 'SSE'

// Custom options (Spanish, long format, 8 cardinal points):
const SP8 = windir(WIND_BEARING, 'es', 'l', 8);
console.log(`Direccion del viento: ${SP8}`); // 'Sureste'

Available Options @v1.2

windir(angle [[[,lang], mode], points])

lang: 'en' | 'es|sp'   
mode: 's'  | 'l'          // short | long
np:    16  |  8  |  4     // 4:  N, S, E, W

Licence

MIT


Marzzelo from Cordoba, Argentina.

Readme

Keywords

Package Sidebar

Install

npm i @marzzelo/windir

Weekly Downloads

1

Version

1.2.3

License

MIT

Unpacked Size

5.94 kB

Total Files

9

Last publish

Collaborators

  • marxxelo