@ilihub/second
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@ilihub/second

TypeScript functions for converting second to other time units.

NPM Version NPM CodeFactor Socket Badge

Installation

# if you're using pnpm
pnpm add @ilihub/second

# or, if you're using npm
npm install @ilihub/second

# or, if you're using yarn
yarn add @ilihub/second

Usage

import { Second } from "@ilihub/second";

const second = new Second(60);

const milliseconds = second.toMillisecond();
console.log(milliseconds); // 60000

const minutes = second.toMinute();
console.log(minutes); // 1

const hours = second.toHour();
console.log(hours); // 0.016666666666666666

const days = second.toDay();
console.log(days); // 0.0006944444444444445

const weeks = second.toWeek();
console.log(weeks); // 0.0000992063492063492

const months = second.toMonth();
console.log(months); // 0.000023148148148148147

const years = second.toYear();
console.log(years); // 0.000001902587519025875

const decades = second.toDecade();
console.log(decades); // 1.9025875190258752e-7

const centuries = second.toCentury();
console.log(centuries); // 1.9025875190258753e-8

Available Functions and Classes


Sponsors & Backers

Support the development of new open-source projects from ilihub through crowdfunding.

The core of ilihub is our crowd-funded open-source projects, licensed under the permissive MIT license. Sponsorship increases the rate of bug fixes, documentation improvements, and feature development.

Sponsors


Package Sidebar

Install

npm i @ilihub/second

Weekly Downloads

8

Version

1.0.1

License

MIT

Unpacked Size

12.4 kB

Total Files

5

Last publish

Collaborators

  • harshraj8843