Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/changjoo-park/dtms
- Owner: ChangJoo-Park
- Created: 2021-03-22T07:04:27.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-16T00:52:10.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T09:09:29.182Z (about 1 month ago)
- Language: TypeScript
- Size: 384 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
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