Closed connerdouglass closed 4 months ago
This PR creates a TypeScript abstraction layer around file access.
This builds on the work by @NexelOfficial in #44
Example usage:
import { Files } from '@customrealms/core'; Files.readString('server.properties'); // => entire file contents Files.writeString('plugin-data.txt', 'score=100'); // => write a file Files.exists('server.properties'); // => true Files.stat('server.properties'); // => {size: 123, isDirectory: false} Files.readdir('/path/to/folder'); // => ["server.properties", "plugins", ...] Files.dirname('/path/to/folder'); // => "/path/to" Files.mkdir('/path/to/folder', true); // recursively create folders Files.remove('my-temp-file.txt'); // remove a file
This PR creates a TypeScript abstraction layer around file access.
This builds on the work by @NexelOfficial in #44
Example usage: