npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

core-units

v1.0.1

Published

Core units converter

Downloads

4

Readme

₡ORE Unit Converter

Install

npm i core-units

Getting started

Example №1

const convert = require('core-units')
const result = convert(1, 'core')
console.log(JSON.stringify(result, null, 2))

Output:

{
  "ore": "1000000000000000000",
  "wav": "1000000000000000",
  "grav": "1000000000000",
  "nucle": "1000000000",
  "atom": "1000000",
  "moli": "1000",
  "core": "1",
  "aer": "0.001",
  "orb": "0.000001",
  "plano": "0.000000001",
  "tera": "0.000000000001",
  "sola": "0.000000000000001",
  "galx": "0.000000000000000001",
  "cluster": "0.000000000000000000001",
  "supermatter": "0.000000000000000000000001"
}

Example №2

const convert = require('core-units')
const result = convert(30, 'nucle')
console.log(JSON.stringify(result, null, 2))

Output:

{
  "ore": "30000000000",
  "wav": "30000000",
  "grav": "30000",
  "nucle": "30",
  "atom": "0.03",
  "moli": "0.00003",
  "core": "0.00000003",
  "aer": "0.00000000003",
  "orb": "0.00000000000003",
  "plano": "0.00000000000000003",
  "tera": "0.00000000000000000003",
  "sola": "0.00000000000000000000003",
  "galx": "0.00000000000000000000000003",
  "cluster": "0.00000000000000000000000000003",
  "supermatter": "0.00000000000000000000000000000003"
}

Specific output examples:

console.log(convert(1, 'core', 'ore')) // 1000000000000000000
console.log(convert(30, 'nucle', 'core')) // 0.00000003
console.log(convert(30, 'nucle', 'ore')) // 30000000000

CLI

Install

npm i -g core-units

Getting started

$ core-units {value} {unit}

Examples

$ core-units 10 core

ore      10000000000000000000
wav      10000000000000000
grav     10000000000000
nucle    10000000000
atom     10000000
moli     10000
core     10
aer      0.01
orb      0.00001
plano    0.00000001
tera     0.00000000001
sola     0.00000000000001
galx     0.00000000000000001
cluster  0.00000000000000000001
supermatter 0.00000000000000000000001
$ core-units 42 nucle

ore      42000000000
wav      42000000
grav     42000
nucle    42
atom     0.042
moli     0.000042
core     0.000000042
aer      0.000000000042
orb      0.000000000000042
plano    0.000000000000000042
tera     0.000000000000000000042
sola     0.000000000000000000000042
galx     0.000000000000000000000000042
cluster  0.000000000000000000000000000042
supermatter 0.000000000000000000000000000000042
$ core-units 1 core ore

1000000000000000000
$ core-units 30 nucle core

0.00000003

Piping value example:

$ echo 1000000000000000000 | core-units ore core

1

Using decimal numbers example:

$ core-units 1000000 -6 core

1
$ core-units 1000000 -6 1

1
$ core-units 1 1 -6

1000000

Contributions

Feel free to contribute in any way.

We appreciate:

Epigram

「Cryptoni Confidimus」

License

Licensed under the CORE License.