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 🙏

© 2026 – Pkg Stats / Ryan Hefner

o_number_normalized

v1.0.7

Published

```javascript // cdn

Readme

importing / installation

// cdn 

import O_number_normalized from "https://unpkg.com/o_number_normalized@latest/o_number_normalized.module.js"

// npm install
import O_number_normalized from "path/to/node_modules/o_number_normalized/o_number_normalized.module.js"

// instanciate
var o_number_normalized = new O_number_normalized()

converting numbers

setting in a "format"

for example degrees

o_number_normalized.n_degrees = 180

number is now automatically converted to all different kinds

o_number_normalized.n_radians // -> 3.141592653589793
o_number_normalized.n_degrees  // -> 180
o_number_normalized.n_percentage // -> 50
o_number_normalized.n_hours // -> 12
o_number_normalized.n_minutes // -> 720
o_number_normalized.n_seconds // -> 43200

getting in a "format"

o_number_normalized.n_radians // -> 3.141592653589793

normalized

the normalized number (holds float value 0-1) is the master

o_number_normalized.n //-> 0.5

hours minutes seconds in modulo

var o_hours_minutes_seconds = {hours: 11, minutes: 23, seconds: 58} 
o_number_normalized.n_hours_modulo = o_hours_minutes_seconds.hours // 11
o_number_normalized.n_minutes_modulo = o_hours_minutes_seconds.minutes // 23
o_number_normalized.n_seconds_modulo = o_hours_minutes_seconds.seconds // 58

o_number_normalized.n_hours // -> 11.399444444444445 // all hours of the day
o_number_normalized.n_minutes // -> 683.9666666666667 // all minutes of the day
o_number_normalized.n_seconds // -> 41038 //all seconds of the day

o_number_normalized.n_hours_modulo // -> 11
o_number_normalized.n_minutes_modulo // -> 23
o_number_normalized.n_seconds_modulo // -> 58

handy snippets

getting hours minutes seconds hms h__m.__s,

o_number_normalized.n = 0.112358
// hours minutes seconds, for example for latitude or longitude
var s_hms = 
    `${o_number_normalized.n_hours_modulo}h${o_number_normalized.n_minutes_modulo}m${o_number_normalized.n_seconds_modulo.toFixed(2)
}s`

s_hms // -> 2h41m47.73s

getting degrees minutes seconds dms d__m.__s,

o_number_normalized.n = 0.112358
// hours minutes seconds, for example for latitude or longitude
var s_dms = 
    `${o_number_normalized.n_degrees_modulo}d${o_number_normalized.n_minutes_modulo}m${o_number_normalized.n_seconds_modulo.toFixed(2)
}s`

s_dms) // -> 40d41m47.73s

custom formats

you can add your own formats by adding a custom config to the a_o_number_normalized_config array

        o_number_normalized.a_o_number_normalized_config.push(
            {
                s_name: "n_inch_per_centimeter", 
                n_max: 2.54, 
                n_min: 0,
                n_modulo_divisor : 2.54, 
            },
        )

    // then you can call it 
    o_number_normalized.n = 10
    o_number_normalized.n_inch_per_centimeter // -> 25.4
    // now we can convert cm to inch 
    o_number_normalized.n_inch_per_centimeter = 100
    o_number_normalized.n // -> 39.37007874015748

converting in one statement / via function call

the name pattern is one of the following .f_n_convert${s_name_of_config}_to_${s_name_of_config} or .f_n_convert${s_name_of_config}2${s_name_of_config} example

o_number_normalized.f_n_convert_n_percentage2n_radians(50) // -> 3.1415...

note, the original value stays the same,

o_number_normalized.n_degrees = 120 // -> 0.2
o_number_normalized.f_n_convert_n_radians2n_degrees(Math.PI) // -> 180
o_number_normalized.n_degrees //->120

custom name patterns

var s_pattern = `CONVERT${o_number_normalized.s_function_name_pattern_var_name}INTO${o_number_normalized.s_function_name_pattern_var_name}`
o_number_normalized.a_s_function_name_pattern.push(s_pattern)
// now we can convert with the custom pattern
o_number_normalized.CONVERTn_degreesINTOn_radians(360) // -> 6.283185307179586

version log

1.0.2

removed some unneccessary console.log stuff

1.0.3

adding package.json keywords

1.0.4

  • documentation updates
  • added the possibility to convert with a function
  • added the possibility to add a custom function name pattern for converting numbers via funciton call

1.0.5

vuejs was not working because somehow the getter was called with s_prop as type symbol, added this to the getter

                
if(typeof s_prop === 'symbol'){
    return Reflect.get(object, s_prop)
}

1.0.6

more changes to make it working with vuejs, but proxies as data objects are not really working in vuejs

1.0.7

reset file to 1.0.3! and then add a return before return Reflect.set... to get it working with vue, it was not working before altough the variable was on window.o_number_normalized