# @benehmke/measurement

> Javascript Classes for storing, and converting units of measurement

Latest version **0.1.0** (published 2022-11-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @benehmke/measurement
pnpm add @benehmke/measurement
yarn add @benehmke/measurement
bun add @benehmke/measurement
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2022-11-21 |
| First published | 2022-11-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ben Ehmke |
| Maintainers | benehmke |
| Keywords | units, measurement, measure |

## Links

- npm: https://www.npmjs.com/package/@benehmke/measurement
- Repository: https://github.com/bemky/measurement
- Homepage: https://github.com/bemky/measurement#readme
- Issues: https://github.com/bemky/measurement/issues
- npm.io page: https://npm.io/package/@benehmke/measurement

## Recent versions

- 0.1.0 (latest) — 2022-11-21

## README

# Measurement
Javascript Classes for storing, and converting units of measurement

## Installation

    npm install @benehmke/measurement

```javascript
import {Length} from 'measurement';

const boxFront = new Length('9 ft');
const boxSide = new Length(4, 'ft');
const boxHeight = new Length({value: 4, unit: 'in'})
```

## Usage

### `to(units)`

```javascript
const boxFront = new Length('9 ft');
console.log(boxFront.to('in'));
// >> 108 in
```

### `valueOf`

```javascript
const distanceA = new Length('9 ft');
const distanceB = new Length('5 m');
console.log(distanceA < distanceB);
// >> true
```

## Units
#### Length
|Name|Label|
| --- | --- |
|Millimeter|`mm`|
|Centimeter|`cm`|
|Meter|`m`|
|Kilometer|`km`|
|Inch|`in`|
|Foot|`ft`|
|Yard|`yd`|
|Mile|`mi`|

#### Area
|Name|Label|
| --- | --- |
|Square Meter|`sqm`|
|Square Foot|`sqft`|
|Tsubo|`tsubo`|

## Development
### TODO
- [ ] Add/Subtract Method
- [ ] Length.toArea
- [ ] Custom Unit rename (ex ft2 for sqft)
- [ ] Volume
- [ ] Weight

### Build
    npm run build
### Test
    npm run test
### Release
    npm publish

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