denoland / denoland/std

Port File System APIs in Deno namespace to `@std/fs`

Open
#6,255 7 comments 9 reactions 0 assignees View on GitHub
enhancement fs
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

We aim to make `@std/fs` cross-runtime (ref #4313). To achieve that we need to port FS APIs from Deno namespace (with Node.js compatibility)

- Deno FS APIs https://docs.deno.com/api/deno/file-system
- deno-shim https://github.com/denoland/node_shims/tree/main/packages/shim-deno/src/deno/stable/functions

### Classes
- [ ] FsFile #6524
- [x] close #6524
- [x] isTerminal #6524
- [ ] lock
- [ ] lockSync
- [x] read #6524
- [x] readSync #6524
- [ ] setRaw
- [x] stat #6524
- [x] statSync #6524
- [x] sync #6524
- [x] syncSync #6524
- [x] syncData #6524
- [x] syncDataSync #6524
- [x] truncate #6524
- [x] truncateSync #6524
- [ ] unlock
- [x] utime #6524
- [x] utimeSync #6524
- [x] write #6524
- [x] writeSync #6524

### Functions
- [x] chmod #6343
- [x] chmodSync #6343
- [x] chown #6552
- [x] chownSync #6552
- [x] copyFile #6425
- [x] copyFileSync #6425
- [x] create #6600
- [x] createSync #6600
- [x] link #6369
- [x] linkSync #6369
- [x] lstat #6276
- [x] lstatSync #6300
- [x] makeTempDir #6391
- [x] makeTempDirSync #6391
- [x] makeTempFile #6469
- [x] makeTempFileSync #6469
- [x] mkdir #6436
- [x] mkdirSync #6436
- [x] open #6524
- [x] openSync #6524
- [x] readDir #6338
- [x] readDirSync #6381
- [x] readFile #6394
- [x] readFileSync #6394
- [x] readLink #6373
- [x] readLinkSync #6373
- [x] readTextFile #6405
- [x] readTextFileSync #6405
- [x] realPath #6366
- [x] realPathSync #6366
- [x] remove #6438
- [x] removeSync #6438
- [x] rename #6379
- [x] renameSync #6396
- [x] stat #6258
- [x] statSync #6300
- [x] symlink #6352
- [x] symlinkSync #6352
- [x] truncate #6416
- [x] truncateSync #6416
- [x] umask #6454
- [x] utime #6446
- [x] utimeSync #6446
- [ ] watchFs
- [x] writeFile #6444
- [x] writeFileSync #6444
- [x] writeTextFile #6463
- [x] writeTextFileSync #6463

`shim-deno` package already implements Node.js compatible Deno APIs. We can borrow the code from there for the Node.js compatibility part https://github.com/denoland/node_shims/tree/main/packages/shim-deno

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.