1.0.7 • Published 3 years ago

@lv00/dot-parser v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

DotParser

Parse dotted string into object

Install

npm install --save @lv00/dot-parser

Usage

import parse from '../lib/index.js'

const data = `battery.charge: 100
battery.charge.low: 20
battery.runtime: 995
battery.type: PbAc
device.mfr: EATON
device.model: Ellipse PRO 650
device.serial: P354M05BE0
device.type: ups
driver.name: usbhid-ups`

console.log(parse(data))

// Terminal Output
{
  battery: {
    charge: { _value: ' 100 ', low: ' 20' },
    runtime: ' 995',
    type: ' PbAc'
  },
  device: {
    mfr: ' EATON',
    model: ' Ellipse PRO 650 ',
    serial: ' P354M05BE0',
    type: ' ups'
  },
  driver: { name: ' usbhid-ups' }
}
1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago