# compass-direction-to-heading

> A simple JavaScript helper to convert a 16-wind compass direction to a degrees heading

Latest version **1.0.3** (published 2019-06-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install compass-direction-to-heading
pnpm add compass-direction-to-heading
yarn add compass-direction-to-heading
bun add compass-direction-to-heading
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-06-21 |
| First published | 2019-06-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 37.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Andrew Hawkes |
| Maintainers | andrewhawkes |
| Keywords | heading, compass, degrees, wind |

## Links

- npm: https://www.npmjs.com/package/compass-direction-to-heading
- Repository: https://github.com/andrewhawkes/compass-direction-to-heading
- Homepage: https://github.com/andrewhawkes/compass-direction-to-heading#readme
- Issues: https://github.com/andrewhawkes/compass-direction-to-heading/issues
- npm.io page: https://npm.io/package/compass-direction-to-heading

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-06-21
- 1.0.1 — 2019-06-20
- 1.0.0 — 2019-06-20

## README

# Compass Direction To Heading
A simple JavaScript helper to convert a [16-wind](https://en.wikipedia.org/wiki/Points_of_the_compass) compass direction to a degrees [heading](https://en.wikipedia.org/wiki/Heading_(navigation)) typically used in aviation.

## Example Usage

```
import compassToHeading from 'compass-direction-to-heading';

const heading = compassToHeading('NNW'); // Returns int 338

console.log(heading); // 338

```

## Installation

### [NPM](https://www.npmjs.com/package/compass-direction-to-heading) 
`npm i compass-direction-to-heading`



## Docs

The helper function accepts a string (any case) containing one of the 16 point values:

| Compass Direction | Heading Returned |
| ------------- |:-------------:|
| N | 360 |
| NNE | 23 |
| NE | 45 |
| ENE | 68 |
| E | 90 |
| ESE | 113 |
| SE | 135 |
| SSE | 158 |
| S | 180 |
| SSW | 203 |
| SW | 225 |
| WSW | 248 |
| W | 270 |
| WNW | 293 |
| NW | 315 |
| NNW | 338 |

_Heading values are based on 16 points at 22.5deg and rounded up_

---
_Source: https://npm.io/package/compass-direction-to-heading · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
