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

eternal_notations

v1.1.1

Published

A JavaScript library that abbreviates really large numbers in various notations, built on break_eternity.js.

Downloads

19

Readme

Eternal Notations

Eternal Notations is a JavaScript library that abbreviates large numbers in various notations, intended for use in incremental games. It's sort of a "sequel" to Antimatter Dimensions Notations, but whereas that library is built on break_infinity.js, which goes up to 10^10^16, Eternal Notations is built on break_eternity.js, which goes up to 10^^(10^308), i.e. a power-tower of 10^308 10's. Try out the various notations (actually presets; more on what the difference is in a moment) here.

Setup

Note: This README was written by MathCookie.

I don't know how things like NPM work yet, so what I'd do is just download eternal_notations.js or eternal_notations.min.js from the dist folder and include it as a script in your HTML file. Eternal Notations requires break_eternity.js to be included, and will not run without it. Eternal Notations only works with break_eternity. If your game uses break_infinity, use Antimatter Dimensions Notations instead. Including eternal_notations.js or eternal_notations.min.js should be sufficient to use all of the notations and almost all of the presets, but if you wish to use Colored Dominoes, you need to include the eternal_notations_images folder in your project and include the dominoes.css file inside as a CSS stylesheet in your HTML file.

That being said, there IS an NPM package, so if you understand NPM, you can run npm i eternal_notations to install it - but I suspect you'll probably still need to include dominoes.css in your HTML file to use Colored Dominoes. ghoqyew is the one who posted the library on NPM, so if something's wrong with the NPM package (but not with the original library), they'll probably be able to fix it better than MathCookie can.

Use

Like in Antimatter Dimensions Notations, all notations are included inside a single object, EternalNotations. The main method you'll be using is format(value):

new EternalNotations.ScientificNotation().format(1e100);
EternalNotations.Presets.Standard.format("ee50");

Unlike in Antimatter Dimensions Notations, only the value is provided as an argument to format. Eternal Notations applies its notations to all numbers, not just ones above 1,000, and the amount of decimal places is a property of the notations themselves, not of the format method.

There are two ways to use this library. If you're looking for something like AD Notations, i.e. a bunch of notations that are easy to quickly add to your incremental game, use the presets, which are included in the EternalNotations.Presets and EternalNotations.HTMLPresets objects. Use EternalNotations.Presets if you're outputting to plain text, use EternalNotations.HTMLPresets if you're outputting to innerHTML. These two objects contain the same presets (with the exception of the aforementioned ColoredDominoes, which only exists in HTMLPresets).

The actual notations, unlike in Antimatter Dimensions Notations, have parameters in their constructors, which allows for a much greater amount of customization. For example, in

new EternalNotations.StandardNotation(1, true)

the first argument is the "dialect", which controls what set of abbreviations for the -illions is being used, and the second argument controls whether the short or long scale is being used. StandardNotation has six arguments, but only the first two are specified here: most parameters have default values they'll take when left undefined, though a select few notations may require their first parameter be defined. Different notations have different parameters, and some have many more than others! In particular, many notations have an innerNotation parameter, which controls how leftover numbers within that notation are themselves formatted, allowing you to mix together notations.

Every notation ends with the word "Notation" to make it clear that it's a notation, not a preset. You do use the new operator when making a new instance of a notation, but you do not use new when accessing presets.

If I've counted correctly, Eternal Notations includes 144 presets and 65 notations, plus some additional utility functions. This includes several (but not all) of the notations from Antimatter Dimensions Notations as presets, and many more than aren't in Antimatter Dimensions Notations, including notations based on tetration, factorials, super-roots, the SI prefixes, and much more. If you just want a reasonable way to notate large numbers similar to how games like Prestige Tree Rewritten do so, use DefaultNotation (its preset is EternalNotations.Presets.Default), which goes from unabbreviated to scientific to hyperscientific. (DefaultNotation is the default innerNotation value for most notations). Otherwise, have fun exploring the many presets and notations Eternal Notations has to offer!

For information on individual presets, notations, and functions, see the documentation page.

Contributing

If you wish to add new presets or notations to Eternal Notations, first decide which of those two things your contribution is going to be. If your idea can be created using the notations that already exist and you're not looking to make something customizable, you probably want to add a preset. If you want to make something that can't be made with the notations that already exist and you have customization options to include for it, you probably want to add a notation. Here are some guidelines for contributing:

  • Include customization for Notations, but not for Presets. The presets are meant to be easy to use, so you probably shouldn't give them parameters. There are a few presets that do have one parameter, but only do so if that parameter is fundamental to the nature of the preset (examples that currently exist include the degree of a root, the base of a logarithm, and the base of an alternate number base). Notations, on the other hand, are meant to be very customizable, so if you can't think of any customization options, you should probably just make a preset, not a notation. In particular, your notation will probably have an innerNotation parameter - if it doesn't, consider whether what you're making should be a preset instead.
  • Do not use CustomNotation when making a preset. CustomNotation exists for users who want to make their own notation for use within their project. It should not be used within the library itself. If you find yourself needing CustomNotation to make a preset because the notations that currently exist aren't sufficient to make that preset, you should create a new notation instead. (If you still think it should be a preset, then try using one of the three Increasing Function notations to make it - those three are very versatile!)
  • Try to avoid making a preset that just messes with the super-logarithm and calls it a day. This one isn't a rule, but it is a recommendation. Many notations in Antimatter Dimensions Notations (Zalgo, Bar, and Blobs, for example) work by doing something with the number's logarithm rather than the number itself, which results in them being boring on smaller numbers. In Eternal Notations, the equivalent would require you to do something with the number's super-logarithm rather than the number itself, which would result in a preset that's boring for all but the largest numbers. It's fine if your notation is explicitly themed around tetration and super-logarithms, but chances are such a notation would fall under the ones that already exist. In general, presets should be interesting for the smaller numbers too!
  • Do something original. The presets shouldn't be flooded with a bunch of small variations of the same notation. When adding presets, make sure that what you're adding is distinct enough from the presets that already exist that it deserves to be its own new preset. As for notations, make sure that the notation you're adding can't already be implemented using another notation that already exists.

If you have an idea for a new preset or notation but don't understand the library well enough to contribute it yourself, feel free to open a new Issue here on the Eternal Notations GitHub page to make your suggestion.