Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/nescalante/timeparse

Time parse utility
https://github.com/nescalante/timeparse

Last synced: 20 days ago
JSON representation

Time parse utility

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