Skip to content

Commit

Permalink
Replace uuid with ulid to support node 18
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Mar 27, 2024
1 parent 173eafe commit 6ac3958
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
bun_ci:
uses: cross-org/workflows/.github/workflows/bun-ci.yml@main
with:
jsr_dependencies: "@cross/test @std/assert @cross/runtime @std/path @cross/dir @std/uuid"
jsr_dependencies: "@cross/test @std/assert @cross/runtime @std/path @cross/dir @std/ulid"
node_ci:
uses: cross-org/workflows/.github/workflows/node-ci.yml@main
with:
jsr_dependencies: "@cross/test @std/assert @cross/runtime @std/path @cross/dir @std/uuid"
jsr_dependencies: "@cross/test @std/assert @cross/runtime @std/path @cross/dir @std/ulid"
test_target: "src/**/*.test.ts"
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ console.log(await mktempdir("my-prefix"));
// -> /tmp/my-prefix-7a8s78-as67d6as6-asd67a6sd-asdyda/
```

| Method | Deno | Node | Bun | Browser (LocalStorage) |
| ---------- | ---- | ---- | --- | ---------------------- |
| unlink | X | X | X | |
| mkdir | X | X | X | |
| mktempdir | X | X | X | |
| rmdir | X | X | X | |
| Method | Deno | Node | Bun | Browser (LocalStorage) |
| --------- | ---- | ---- | --- | ---------------------- |
| unlink | X | X | X | |
| mkdir | X | X | X | |
| mktempdir | X | X | X | |
| rmdir | X | X | X | |
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@cross/test": "jsr:@cross/test@^0.0.9",
"@std/assert": "jsr:@std/assert@^0.220.1",
"@std/path": "jsr:@std/path@^0.220.1",
"@std/uuid": "jsr:@std/uuid@^0.220.1"
"@std/ulid": "jsr:@std/ulid@^0.220.1"
},
"publish": {
"exclude": [".github", "*.test.ts"]
Expand Down
4 changes: 2 additions & 2 deletions src/ops/mktempdir.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dir } from "@cross/dir";
import { generate } from "@std/uuid/v1";
import { ulid } from "@std/ulid";
import { join } from "@std/path";
import { mkdir } from "./mkdir.ts";

Expand All @@ -12,7 +12,7 @@ import { mkdir } from "./mkdir.ts";
*/
export async function mktempdir(prefix?: string): Promise<string> {
const tempBaseDir = await dir("tmp");
let uuid = generate();
let uuid = ulid();
if (prefix) {
uuid = `${prefix}-${uuid}`;
}
Expand Down

0 comments on commit 6ac3958

Please sign in to comment.