Skip to content

Commit

Permalink
update readme for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart Veneman committed Apr 14, 2024
1 parent c303837 commit 790c7dc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ npm install css-time-sort
## Usage

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

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

const { sortFn } = require("css-time-sort");
const result = ["3s", "2ms"].sort(sortFn);

// RESULT:
// => ['2ms', '3s']
// Converting time-like values
convert("1s"); // 1000
convert("1ms"); // 1
convert("+2ms"); // 2
convert("var(--foo)"); // Number.MAX_SAFE_INTEGER - 1
convert("bars"); // Number.MAX_SAFE_INTEGER
```

## Notes
Expand Down

0 comments on commit 790c7dc

Please sign in to comment.