0.0.1 • Published 3 years ago

parse-physical v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

parse-physical

NPM version build status Test coverage npm download

Try to parse a string containing physical data like bp, mp.

Installation

$ npm i parse-physical

Usage

import { parseBP, parseMP, parseNumbersUnit } from 'parse-physical';

let bp = parseBP('100-120 @ 50 mmHg', {
  temperature: {
    defaultUnit: '°C'
  }
  pressure: {
    defaultValue: 760,
    defaultUnit: 'mmHg'
  }
})

// bp: {temperature: {low: 100, high: 120, unit: '°C'}, pressure: {low: 50, unit: 'mmHg'}};

let density = parseNumbersUnit('1.5-1.51', {
  defaultUnit: 'g/mL'
})

// density: {low: 1.5, high: 1.51, unit: 'g/mL'}

API Documentation

License

MIT

0.0.1

3 years ago