0.4.0 • Published 1 year ago

physical-parser v0.4.0

Weekly downloads
10
License
MIT
Repository
github
Last release
1 year ago

physical-parser

NPM version build status Test coverage npm download

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

Installation

$ npm i physical-parser

Usage

import { parseBoilingPoint, parseDensity, parseRefactiveIndex, parseNumbersUnits } from 'physical-parser';

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

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

let density = parseDensity('1.5-1.51, t=25', {
  value: {
    defaultUnits: 'g/mL'
  },
  temperature: {
    defaultUnits: '°C'
  }
})

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

API Documentation

License

MIT

0.4.0

1 year ago

0.3.2

1 year ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.3

3 years ago