Skip to content

Commit

Permalink
docs(parse-duration): enhance readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm authored and alimd committed Jan 15, 2024
1 parent fd32008 commit 26faa6c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/parse-duration/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Parse-duration

Parse duration string to target unit.
A simple utility to parse a duration string into milliseconds.

## Installation

Expand All @@ -11,6 +11,8 @@ yarn add @alwatr/parse-duration
## Usage

```js
import {parseDuration} from '@alwatr/parse-duration';

parseDuration('10s'); // 10,000
parseDuration('10m'); // 600,000
parseDuration('10h'); // 36,000,000
Expand All @@ -23,12 +25,12 @@ parseDuration('10d', 'h'); // 240

### Abbreviation Table

| Abbreviation | Description |
| :---: | :---: |
| `s` | Second |
| `m` | Minute |
| `h` | Hour |
| `d` | Day |
| `w` | Week |
| `M` | Month |
| `y` | Year |
| Abbreviation | Description |
|--------------|-------------|
| `s` | Second |
| `m` | Minute |
| `h` | Hour |
| `d` | Day |
| `w` | Week |
| `M` | Month |
| `y` | Year |

0 comments on commit 26faa6c

Please sign in to comment.