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

passed-time

v1.1.0

Published

get how much time has passed before reached this momentcls

Readme

PASSED-TIME

Welcom

This is a simple module that allow you to get the difference between two time left from a previous past time to now. eg:2minleft this module support es5 and es2015

Introduction

The idea is to allow with a simple module be able to get the interval of time that left from a previous time until now.

  • whats you can do with

    • you can get how much times left form a previus time untill now
    • you can get the inteval of time according to a defined time such as thisweek, lastweek,days of this month
  • whats it can do. apart from those module, other expected are not avaible.

Installation

    npm install time-passed

Integration

The module is very easy to use.

  • step one : Date Format you need to have a date with this formatY-M-dd eg: 2020-12-15 and if there is time the following format is required to avoid crash, Y-M-dd h:m:s eg 2020-12-15 15:40:00.

  • step two : integration include the module and form there you can pas the date as parametter, as show in the example bellow. require or import are both support

  • for ES5 or ES2017

  • getTimePassed this method allow to get how much time passed until nom.
    const passedTime = require("passed-time");
    let date="2020-12-17 10:23";
    const pt= passedTime(date)
    console.log(pt.getTimePassed());    

this out put look like, it will be defferent according the time you will test

    1d
  • in case you would like to get more detail you can diffine the configuration detail to true
    const {PassedTime} = require("passed-time");
    // import {PassedTime} from "passed-time"; 
    let date="2020-12-17 10:23";
    const pt= new PassedTime(date)
    console.log(pt.getTimePassed({detail:true}));
    1d 7h 34m 50s

you can display allow available module as shown on the exemple bellow

    const {  PassedTime } = require('passed-time');

    let dat="2020-12-17 10:23";

    let past = new PassedTime(dat);

    let config={
        detail:true
    };

    let time = {
        timeLeft:past.getTimePassed(config),
        daysOfMonth:tp.getDayOfMonth(),
        thisWeekPeriod:tp.getThisWeek(),
        lastWeekPeriod:tp.getLastWeek(),
        thisTrimester:tp.getTriSemester()
    };
    console.log(time);

checkout ou the response will looks like

    {
        timeLeft: '1d 7h 37m 28s',
        daysOfMonth: 31,
        thisWeekPeriod: { from: '2020-12-13', to: '2020-12-19' },
        lastWeekPeriod: { from: '2020-12-06', to: '2020-12-12' },
        thisTrimester: { from: '2020-09-17', to: '2020-12-17' }
    }

in case you need to get the differnet between two date

    let date={
        firstDate:"2020-12-17 10:23",
        secondDate:"2020-12-17 10:20"
    };
    let tp = new PassedTime(dat);
    console.log(tp.getTimePassed(config))

this is the output

    3m 0s