Skip to content

Commit 790c7dc

Browse files
author
Bart Veneman
committed
update readme for v2
1 parent c303837 commit 790c7dc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

readme.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ npm install css-time-sort
1212
## Usage
1313

1414
```js
15-
const cssTimeSort = require("css-time-sort");
16-
const result = cssTimeSort(["3s", "2ms"]);
15+
import { convert, compare } from "css-time-sort";
1716

18-
// OR:
17+
let result = ["3s", "2ms"].sort(compare); // ["2ms", "3s"]
1918

20-
const { sortFn } = require("css-time-sort");
21-
const result = ["3s", "2ms"].sort(sortFn);
22-
23-
// RESULT:
24-
// => ['2ms', '3s']
19+
// Converting time-like values
20+
convert("1s"); // 1000
21+
convert("1ms"); // 1
22+
convert("+2ms"); // 2
23+
convert("var(--foo)"); // Number.MAX_SAFE_INTEGER - 1
24+
convert("bars"); // Number.MAX_SAFE_INTEGER
2525
```
2626

2727
## Notes

0 commit comments

Comments
 (0)