Socket
Book a DemoInstallSign in
Socket

dtms

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dtms

A converter css time to milliseconds

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

dtms - CSS d[uration|elay] to milliseconds

dtms

dtms is <time> of CSS parse in to milliseconds for JavaScript.

import { dtms } from 'dtms'
dtms('0.2s') // returns 200 (milliseconds)
dtms('2s') // returns 2000 (milliseconds)
dtms('0s') // returns 0 (milliseconds)
dtms('-1s') // returns -1000 may not working with transition

// Not Allowed
dtms('') // Not alllowed empty string.
dtms('2m') // Only support ms and s from CSS specification

Why only support milliseconds?

CSS <time> is only 'ms' and 's'.

https://developer.mozilla.org/en-US/docs/Web/CSS/time

FAQs

Package last updated on 22 Mar 2021

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