New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tinycron

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinycron

The low-weight library to handle dates in a human-readable way

  • 0.6.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Tinycron

The low-weight library to handle date objects in a human-readable way

Install

To use this library you can install it via npm

npm install tinycron

How to use it

To use this tool you must import the package in your code

import Tinycron from 'tinycron'

Or

const tinycron = require('tinycron')

Now create an instance of Tinycron class.

const date = new Date(1998, 9, 19);
const tinycron = new Tinyscron(date);

After that, you can call the method toNow to show the time between the specificied date and the current date

const result = tinycron.toNow();
console.log(result); // 22 years ago

Parameters

nametypedescriptionrequired
dateDateThe date you want to compare withtrue
langstringLanguage to show. Ex: en, es ...false

Methods

toNow

Return a string with the elapsed time between the base date and current date. Ex:

tinycron.toNow(); // A minute ago
to:

Receive a date object as a parameter and return a string with the elapsed time between the base date and specified date. Ex:

tinycron.to(new Date()); // A minute ago

Keywords

FAQs

Package last updated on 10 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc