Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/changjoo-park/dtms

Duration string to integer
https://github.com/changjoo-park/dtms

Last synced: 16 days ago
JSON representation

Duration string to integer

Awesome Lists containing this project

README

        

# dtms - CSS d[uration|elay] to milliseconds

dtms is `

## Install

```
yarn add dtms # npm install dtms
```

## Usage

```js
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 `

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