end-of-time

In case you're curious, this will give you the end of time. Get ready.

Usage no npm install needed!

<script type="module">
  import endOfTime from 'https://cdn.skypack.dev/end-of-time';
</script>

README

End of time is coming!

Description

Totally useless little module that assumes the world will end when the JavaScript Date.now() goes above Number.MAX_SAFE_INTEGER

Code

var EndOfTime = function() {
    return {
        millisecondsToYears : function (ms) {
            return Math.floor(ms / (1000 * 60 * 60 * 24 * 356));
        },
        getThisYear : function(){
            return new Date().getFullYear();
        },
        getMaxYear : function(){
            return this.millisecondsToYears(Number.MAX_SAFE_INTEGER);
        },
        getYearsLeft : function(){
            return this.getMaxYear() - this.getThisYear();
        }
    }
}

module.exports = EndOfTime;

Test

npm test