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

brew-date

v1.4.5

Published

A simple javascript package that gives a decent workaround with Dates.

Downloads

15

Readme

A simple javascript package that gives a decent workaround with Dates.

Keep it clean and simple - Development!

Install brew-date by running

npm install brew-date

getFullDate("yyyy/mm/dd")

getFullDate takes up single parameter which is the format of the date. It takes either {"yyyy/mm/dd" || "dd/mm/yyyy"}.

getFullDate(format);

format()

format takes up two parameter, First one is the date and second one is the format {"yyyy/mm/dd" || "dd/mm/yyyy"}.

format(date, format);

formatDate()

formatDate take up parameter as number in the order of year, month, date.

formatDate(year, month, date);

diffBetween()

diffBetween takes up two parameter to return the difference between of two dates in days.

diffBetween(date1, date2);

It takes current date as default second date if not provided.

subDates()

subDates takes up a two parameter, it subtracts the provided date with a number. Returns a date.

subDates(date, number);

subDay()

subDay takes up a two parameter, it subtracts the the provided date with the number, returns a day.

addDates()

addDates takes up a two parameter, it adds the provided date with the number, return a date.

ago()

ago takes up a two date parameter with or without time.

ago(date1 with time, date2 with time);

It takes current date as the default second date if not provided.

It takes date's 12:00 as the default time if not provided.

getDay()

getDay takes a only one parameter as date and return the day of provided date.

getDay(date)

diffSeconds()

diffSeconds takes up two paramter with time to return difference betwen of two dates in seconds.

diffSeconds(date1 with time, date2 with time);

Default date 2 would be current date and time if not provided.

default time would be 12:00, if time has not provided.

diffMinutes()

diffMinutes takes up two parameter with time to return difference between two dates in minutes.

diffMinutes(date1 with time, date2 with time);

Default date 2 would be current date and time if not provided.

default time would be 12:00 if not provided.

diffHours()

diffHours takes up two parameter with time to return difference between two dates in Hours.

diffHours(date1 with time, date2 with time);

Default date 2 would be current date and time if not provided.

default time would be 12:00 if not provided.

diffDays()

diffDays takes up two parameter with time to return difference between two dates in Days.

diffDays(date1 with time, date2 with time);

Default date 2 would be current date and time if not provided.

default time would be 12:00 if not provided.

diffWeeks()

diffWeeks takes up two parameter with time to return difference between two dates in weeks

diffWeeks(date1 with time, date2 with time);

Default date 2 would be current date and time if not provided.

default time would be 12:00 if not provided.

diffYears()

diffYears takes up two parameter with time to return difference between two dates in Years.

diffYears(date1 with time, date2 with time);

Default date 2 would be current date and time if not provided.

default time would be 12:00 if not provided.

diffMonths()

diffMonths takes up two parameter with time to return difference between two dates in Months.

diffMonths(date1 with time, date2 witht time);

Default date 2 would be current date and time if not provided.

default time would be 12:00 if not provided.

getBetween()

getBetween takes up two parameter to return the dates between the two provided dates.

getBetween(date1, date2);

Between dates would be return in array format.