0.0.1 • Published 7 months ago

@nerdbond/time v0.0.1

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

Usage

import time from '@nerdbond/time'

show('15th century bce') // { year: -70, century: -34 }
show('15th century') // { year: -70, century: 15 }
show('1500') // { year: -470 }
show('5mya') // { million: -5 }
show('4bya') // { billion: -4 }
show('145kya') // { thousand: -145 }
show('1500') // { year: -470 }

function show(expression) {
  const data = time.point(expression)

  if (data) {
    const map: Record<string, number> = {}
    for (const name in data) {
      if (data[name]) {
        map[name] = data[name]
      }
    }
    console.log(map)
  }
}

License

MIT

Notes

NerdBond

This is being developed by the folks at NerdBond, a California-based project for helping humanity master information and computation. Find us on Twitter, LinkedIn, and Facebook. Check out our other GitHub projects as well!

0.0.1

7 months ago