aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-types/tests/fs.test-d.ts
blob: a752889df820240696b2846e36713c58303ad7dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { watch } from "node:fs";
import * as tsd from "tsd";
import * as fs from "fs";
import { exists } from "fs/promises";

tsd.expectType<Promise<boolean>>(exists("/etc/passwd"));
tsd.expectType<Promise<boolean>>(fs.promises.exists("/etc/passwd"));

// file path
watch(".", (eventType, filename) => {
  console.log(`event type = ${eventType}`);
  if (filename) {
    console.log(`filename = ${filename}`);
  }
});

Bun.file("sdf").exists();