Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nescalante/timeparse
Time parse utility
https://github.com/nescalante/timeparse
Last synced: 20 days ago
JSON representation
Time parse utility
- Host: GitHub
- URL: https://github.com/nescalante/timeparse
- Owner: nescalante
- License: mit
- Created: 2015-02-23T17:23:04.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-01T01:14:38.000Z (over 7 years ago)
- Last Synced: 2024-11-10T03:53:09.310Z (about 1 month ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- License: License
Awesome Lists containing this project
README
# Time Parse [![Greenkeeper badge](https://badges.greenkeeper.io/nescalante/timeparse.svg)](https://greenkeeper.io/)
> Time parse utility
## Install
Using `npm`
```
npm install timeparse
```## Usage
```js
var timeparse = require('timeparse');
var result = timeparse('2m2s'); // 122000 (2 minutes and 2 seconds in milliseconds)
var result2 = timeparse('3m43s', 's') //223 (3 minutes, 43 seconds in seconds)
var result3 = timeparse('46.30ms', 'μs') //46300
```## Units
- **w**: weeks
- **d**: days
- **h**: hours
- **m**: minutes
- **s**: seconds
- **ms**: milliseconds
- **μs**: microseconds## License
MIT