bare-fs 4.6.0 → 4.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/promises.d.ts CHANGED
@@ -30,6 +30,8 @@ interface FileHandleEvents extends EventMap {
30
30
  }
31
31
 
32
32
  interface FileHandle extends EventEmitter<FileHandleEvents>, AsyncDisposable {
33
+ readonly fd: number
34
+
33
35
  close(): Promise<void>
34
36
 
35
37
  read(
@@ -54,6 +56,16 @@ interface FileHandle extends EventEmitter<FileHandleEvents>, AsyncDisposable {
54
56
 
55
57
  chmod(mode: string | number): Promise<void>
56
58
 
59
+ chown(uid: number, gid: number): Promise<void>
60
+
61
+ datasync(): Promise<void>
62
+
63
+ sync(): Promise<void>
64
+
65
+ truncate(len?: number): Promise<void>
66
+
67
+ utimes(atime: number | Date, mtime: number | Date): Promise<void>
68
+
57
69
  createReadStream(opts?: ReadStreamOptions): ReadStream
58
70
 
59
71
  createWriteStream(opts?: WriteStreamOptions): WriteStream
@@ -85,16 +97,26 @@ export function appendFile(
85
97
 
86
98
  export function chmod(filepath: Path, mode: string | number): Promise<void>
87
99
 
100
+ export function chown(filepath: Path, uid: number, gid: number): Promise<void>
101
+
88
102
  export function copyFile(src: Path, dst: Path, mode?: number): Promise<void>
89
103
 
90
104
  export function cp(src: Path, dst: Path, opts?: CpOptions): Promise<void>
91
105
 
106
+ export function lchown(filepath: Path, uid: number, gid: number): Promise<void>
107
+
108
+ export function lutimes(filepath: Path, atime: number | Date, mtime: number | Date): Promise<void>
109
+
110
+ export function link(src: Path, dst: Path): Promise<void>
111
+
92
112
  export function lstat(filepath: Path): Promise<Stats>
93
113
 
94
114
  export function mkdir(filepath: Path, opts?: MkdirOptions): Promise<void>
95
115
 
96
116
  export function mkdir(filepath: Path, mode: number): Promise<void>
97
117
 
118
+ export function mkdtemp(prefix: Path): Promise<string>
119
+
98
120
  export function opendir(
99
121
  filepath: Path,
100
122
  opts: OpendirOptions & { encoding?: BufferEncoding }
@@ -245,10 +267,16 @@ export function rmdir(filepath: Path): Promise<void>
245
267
 
246
268
  export function stat(filepath: Path): Promise<Stats>
247
269
 
270
+ export function statfs(filepath: Path): Promise<StatFs>
271
+
272
+ export function truncate(filepath: Path, len?: number): Promise<void>
273
+
248
274
  export function symlink(target: Path, filepath: Path, type?: string | number): Promise<void>
249
275
 
250
276
  export function unlink(filepath: Path): Promise<void>
251
277
 
278
+ export function utimes(filepath: Path, atime: number | Date, mtime: number | Date): Promise<void>
279
+
252
280
  export function watch(
253
281
  filepath: Path,
254
282
  opts: WatcherOptions & { encoding?: BufferEncoding }
package/promises.js CHANGED
@@ -51,6 +51,26 @@ class FileHandle extends EventEmitter {
51
51
  await fs.fchmod(this.fd, mode)
52
52
  }
53
53
 
54
+ async chown(uid, gid) {
55
+ await fs.fchown(this.fd, uid, gid)
56
+ }
57
+
58
+ async datasync() {
59
+ return fs.fdatasync(this.fd)
60
+ }
61
+
62
+ async sync() {
63
+ return fs.fsync(this.fd)
64
+ }
65
+
66
+ async truncate(len) {
67
+ await fs.ftruncate(this.fd, len)
68
+ }
69
+
70
+ async utimes(atime, mtime) {
71
+ await fs.futimes(this.fd, atime, mtime)
72
+ }
73
+
54
74
  createReadStream(opts) {
55
75
  return fs.createReadStream(null, { ...opts, fd: this.fd })
56
76
  }
@@ -71,11 +91,16 @@ exports.open = async function open(filepath, flags, mode) {
71
91
  exports.access = fs.access
72
92
  exports.appendFile = fs.appendFile
73
93
  exports.chmod = fs.chmod
94
+ exports.chown = fs.chown
74
95
  exports.constants = fs.constants
75
96
  exports.copyFile = fs.copyFile
76
97
  exports.cp = fs.cp
98
+ exports.lchown = fs.lchown
99
+ exports.lutimes = fs.lutimes
100
+ exports.link = fs.link
77
101
  exports.lstat = fs.lstat
78
102
  exports.mkdir = fs.mkdir
103
+ exports.mkdtemp = fs.mkdtemp
79
104
  exports.opendir = fs.opendir
80
105
  exports.readFile = fs.readFile
81
106
  exports.readdir = fs.readdir
@@ -85,6 +110,8 @@ exports.rename = fs.rename
85
110
  exports.rm = fs.rm
86
111
  exports.rmdir = fs.rmdir
87
112
  exports.stat = fs.stat
113
+ exports.statfs = fs.statfs
114
+ exports.truncate = fs.truncate
88
115
  exports.symlink = fs.symlink
89
116
  exports.unlink = fs.unlink
90
117
  exports.utimes = fs.utimes