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

artimeago

v1.0.2

Published

A package made specifically for arabic timeAgo calculations.

Downloads

8

Readme

arTimeAGo

An NPM package made specifically for arabic timeAgo calculations.

Features

1- fully compatible with arabic grammer.

2- ability to provide a max number of days after which the function will stop converting

for web:

<script src="https://unpkg.com/[email protected]/arTimeAgo.js></script>

Examples

arTimeAgo({date:Date.now()}) // "ألآن"
arTimeAgo({date:Date.now()-1000}) // "منذ ثانية"
arTimeAgo({date:Date.now()-1000*2}) // "منذ ثانيتين"
arTimeAgo({date:Date.now()-1000*50}) // "منذ 50 ثانية"

arTimeAgo({date:Date.now()-1000*60}) // "منذ دقيقة"
arTimeAgo({date:Date.now()-1000*60*3}) // "منذ 3 دقائق"

arTimeAgo({date:Date.now()-1000*60*60}) // "منذ ساعة"
arTimeAgo({date:Date.now()-1000*60*60*21}) // "منذ 21 ساعة"

arTimeAgo({date:Date.now()-1000*60*60*25}) // "منذ يوم"
arTimeAgo({date:Date.now()-1000*60*60*25*2}) // "منذ يومين"
arTimeAgo({date:Date.now()-1000*60*60*25*4}) // "منذ 4 أيام"

arTimeAgo({date:Date.now()-1000*60*60*25*7}) // "منذ أسبوع"

arTimeAgo({date:Date.now()-1000*60*60*24*14}) // "منذ أسبوعين"
arTimeAgo({date:Date.now()-1000*60*60*24*21}) //"منذ 3 أسابيع"

arTimeAgo({date:Date.now()-1000*60*60*24*30}) // "منذ شهر"
arTimeAgo({date:Date.now()-1000*60*60*24*30*5}) //"منذ 5 أشهر"

arTimeAgo({date:Date.now()-1000*60*60*24*30*13}) // "منذ سنة"
arTimeAgo({date:Date.now()-1000*60*60*24*30*24}) // "منذ سنتين"
arTimeAgo({date:Date.now()-1000*60*60*24*30*36}) // "منذ 3 سنوات"
arTimeAgo({date:Date.now()-1000*60*60*24*30*150}) // "منذ 12 سنة"

...
...

the function doesn't know when to stop converting, this scencario might be bad if you are using this in your blog ( I mean you don't want them to see "منذ 4 سنوات" ) so you provide another pararmenter called max // in days

Examples

let's say we don't want to convert any dates after 5 months (5*30 days)

Normal behavior:

arTimeAgo({date:Date.now()-1000*60*60*24*30*6}) //"منذ 6 أشهر"

with max property:

arTimeAgo({date:Date.now()-1000*60*60*24*30*6, max:5*30}) // "١١ نوفمبر ٢٠٢٠"

Authors