Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
:watch: Convert seconds or miliseconds to hh:mm:ss
format and vice versa.
var TimeFormat = require('hh-mm-ss')
TimeFormat.toS('137:00:00') // 493200
TimeFormat.toS('02:00') // 120
TimeFormat.toS('02:00', 'hh:mm') // 7200
TimeFormat.fromS(194) // '03:14'
TimeFormat.fromS(150, 'hh:mm:ss') // '00:02:30'
TimeFormat.fromS(8100, 'hh:mm') // '02:15'
TimeFormat.fromMs(12345) // '00:12.345'
toMs(time, format)
Convert given hh:mm:ss
formatted string to miliseconds
time
String representationformat
(optional) Default input format. If present, it will be used to resolve amiguities during interpretation. If not specified, mm:ss
is implied. See section below for supported format listtoS(time, format)
Convert given hh:mm:ss
formatted string to seconds
time
String representationformat
(optional) Default input format. If present, it will be used to resolve amiguities during interpretation. If not specified, mm:ss
is implied. See section below for supported format listfromMs(ms, format)
Generate formatted string from time in miliseconds
ms
Time in milisecondsformat
(optional) Default output format. If not specified, mm:ss
is implied. See section below for supported format list.fromS(s, format)
Generate formatted string from time in seconds
s
Time in secondsformat
(optional) Default output format. If not specified, mm:ss
is implied. See section below for supported format listThe following formats are supported: mm:ss
, hh:mm
, hh:mm:ss
, mm:ss.sss
, hh:mm:ss.sss
.
hh
- hoursmm
- minutesss
- secondsss
- milisecondsSpecified format constitutes a baseline for corresponding functions, but will be appropriately extended as needed. For example, fromMs(9000, 'mm:ss')
will return 01:30
, yet fromMs(9500, 'mm:ss')
will return 01:30.500
to account for the miliseconds part.
npm install hh-mm-ss --save
MIT
FAQs
Simple hh:mm:ss time formatting utility
The npm package hh-mm-ss receives a total of 3,914 weekly downloads. As such, hh-mm-ss popularity was classified as popular.
We found that hh-mm-ss demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.