mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 16:13:12 +09:00
Remove fs-extra and klaw (#882)
These packages are obsoleted by the promises API to the built-in Node fs module. The fs-extra package is also causing problems with broken APIs that don't behave the same as Node's fs module, and throwing errors without code properties on them.
This commit is contained in:
1 parent
130dca4261
commit
2e48b728dd
74 files changed
+570
-529
No files matched your search
@@ -3,7 +3,7 @@
|
||||
* @module lib/hash
|
||||
*/
|
||||
import crypto from "crypto";
|
||||
import fs from "fs-extra";
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
|
||||
/**
|
||||
@@ -35,6 +35,6 @@ export function hashStream(stream: NodeJS.ReadableStream): Promise<string> {
|
||||
* @param path - Path to the file to hash.
|
||||
* @returns hash of the file given.
|
||||
*/
|
||||
export function hashFile(path: string) {
|
||||
return hashStream(fs.createReadStream(path));
|
||||
export async function hashFile(path: string) {
|
||||
return hashStream((await fs.open(path)).createReadStream());
|
||||
}
|
||||
Reference in new issue
Block a user