@jamangile/measured
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Measured - Autocast information into rich data.

Autocast information into data points.


InstallationUsageDocumentationContributionsLicense

GitHub package.json version Coverage Status

A simple, extensible data utility that auto casts information into data points.

Installation

Installed via npm

npm install @jamangile/measured

Usage

Use whenever you know very little about the incoming information. Measured will clean the data on the fly.

import measured from '@jamangile/measured';

// ** Optional**
// You can overwrite the default options.
measured.setoptions({
  decimalseparator: [',', '.'] // Defaults to just `.`
})

// autocast the information.
const autocast = measured({
  a: '',
  b: 'false',
  c: '35.3',
  d: '10,4%',
  e: '2020-05-21',
  f: 'hello word',
  g: ['list', 'of', 'things']
})

// use the `type` property to know what this has been cast to.
console.log(autocast.type) // .type = 'dictionary'

// use the `value` property to access the data.
console.log(10 * autocast.value.d) // 10 * 0.104
console.log(autocast.value.g.type) // .type = 'list'

Documentation

The complete documentation can be found here

Contributions

Please contribute in one of the following ways:

  • Give the project a star if you like the work.
  • 👁️ Watch the project for up-coming updates.

Contribution guidelines coming soon.

License

Measured is licensed under a ISC License

Package Sidebar

Install

npm i @jamangile/measured

Weekly Downloads

2

Version

0.1.3

License

ISC

Unpacked Size

169 kB

Total Files

103

Last publish

Collaborators

  • athenkosi