# nucos

> NOAA Unit Conversion for Oil Spills

Latest version **1.5.0** (published 2025-06-06) · CC0 1.0 license · 0 weekly downloads

## Install

```sh
npm install nucos
pnpm add nucos
yarn add nucos
bun add nucos
```

## Health

**Score 35/100 (D)** — status: stable.

Positive: no vulnerabilities.

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

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2025-06-06 |
| First published | 2016-03-06 |
| Weekly downloads | 0 |
| License | CC0 1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 39.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Naomi Wilkins |
| Maintainers | naomi.wilkins-noaa, chris_barker-noaa, jamesmakela-noaa |
| Keywords | unit, converter, NOAA, oil, spill, mass, volume, latitude, longitude |

## Links

- npm: https://www.npmjs.com/package/nucos
- Repository: https://github.com/NOAA-ORR-ERD/NUCOS
- Homepage: https://github.com/NOAA-ORR-ERD/pyNUCOS#readme
- Issues: https://github.com/NOAA-ORR-ERD/pyNUCOS/issues
- npm.io page: https://npm.io/package/nucos

## Recent versions

- 1.5.0 (latest) — 2025-06-06
- 1.4.2 — 2025-05-04
- 1.4.1 — 2025-04-22
- 1.4.0 — 2025-04-02
- 1.3.9 — 2021-09-29
- 1.3.8 — 2021-09-28
- 1.3.7 — 2021-09-16
- 1.3.6 — 2020-09-14
- 1.3.5 — 2020-09-09
- 1.3.4 — 2020-09-02
- 1.3.3 — 2020-07-14
- 1.3.2 — 2020-07-09
- 1.3.1 — 2020-03-26
- 1.3.0 — 2020-01-23
- 1.2.10 — 2019-07-19
- … 2 more at https://npm.io/package/nucos/versions

## README

# Nucos (NOAA Unit Conversion for Oil Spills)

Used for converting temperature, volume, and mass.

## Basic Usage


### Convert when the unit types are the same:
```
nucos.convert(unitType, fromUnit, toUnit, value)
```
Example:
```
nucos.convert("Density", "API degree", "kg/m^3", 10)
```
### Convert between different quantities (volume and mass)

  Instantiate the OilQuantityConverter off of nucos
  ```
  var oilConverter = new nucos.OilQuantityConverter();
  ```
  Use the Convert method off of the OilQuantityConverter class
  ```
  oilConverter.Convert(fromAmount, fromUnit, Density, DensityUnits, toUnit);
  ```
  Example with inputs:
  ```
  oilConverter.Convert(50, "tons", 10, "API degree", "cubic meters");
  ```

## Development

nucos is written in javascript, and packages as an NPM package.

### Testing

Tests are using the mocha test framework: https://mochajs.org/

### To install mocha:

`npm i --global mocha`

Installing it globally makes the mocha command available on the command line.

### To run the tests:

`mocha tests/`

The test are in the `tests/test.js file`

See the mocha docs for how to update/write new tests.

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