Skip to content

@pumpkin-plugins/static-hermes-runtime API / hermes/system / HermesFileSystem

Interface: HermesFileSystem ​

Defined in: hermes/system.ts:28

Filesystem operations used by Hermes preparation, with an injectable test boundary.

Methods ​

closeSync() ​

closeSync(fd): void

Defined in: hermes/system.ts:30

Close an open file descriptor.

Parameters ​

fd ​

number

Returns ​

void


existsSync() ​

existsSync(path): boolean

Defined in: hermes/system.ts:32

Test whether a file or directory exists.

Parameters ​

path ​

PathLike

Returns ​

boolean


fstatSync() ​

fstatSync(fd): Stats

Defined in: hermes/system.ts:34

Read file metadata directly from an open file descriptor.

Parameters ​

fd ​

number

Returns ​

Stats


lstatSync() ​

lstatSync(path): Stats

Defined in: hermes/system.ts:36

Read file metadata without following a symbolic link.

Parameters ​

path ​

PathLike

Returns ​

Stats


mkdirSync() ​

mkdirSync(path, options?): string | undefined

Defined in: hermes/system.ts:38

Create a directory, optionally including its parents.

Parameters ​

path ​

PathLike

options? ​

MakeDirectoryOptions

Returns ​

string | undefined


openSync() ​

openSync(path, flags): number

Defined in: hermes/system.ts:40

Open a file with the requested flags and return its descriptor.

Parameters ​

path ​

PathLike

flags ​

OpenMode

Returns ​

number


readdirSync() ​

readdirSync(path): string[]

Defined in: hermes/system.ts:42

List the names of entries in a directory.

Parameters ​

path ​

PathLike

Returns ​

string[]


readFileSync() ​

Call Signature ​

readFileSync(path, encoding): string

Defined in: hermes/system.ts:44

Read a file as text using the requested encoding.

Parameters ​
path ​

PathOrFileDescriptor

encoding ​

BufferEncoding

Returns ​

string

Call Signature ​

readFileSync(path): Buffer

Defined in: hermes/system.ts:46

Read a file as raw bytes.

Parameters ​
path ​

PathOrFileDescriptor

Returns ​

Buffer


renameSync() ​

renameSync(oldPath, newPath): void

Defined in: hermes/system.ts:48

Rename a file or directory.

Parameters ​

oldPath ​

PathLike

newPath ​

PathLike

Returns ​

void


rmSync() ​

rmSync(path, options?): void

Defined in: hermes/system.ts:50

Remove a file or directory, optionally ignoring missing paths and recursing.

Parameters ​

path ​

PathLike

options? ​

RmOptions

Returns ​

void


statSync() ​

statSync(path): Stats

Defined in: hermes/system.ts:52

Read file metadata, including its size and modification time.

Parameters ​

path ​

PathLike

Returns ​

Stats


writeFileSync() ​

writeFileSync(path, data, options?): void

Defined in: hermes/system.ts:54

Write text or bytes to a file, with optional open flags and encoding.

Parameters ​

path ​

PathOrFileDescriptor

data ​

string | ArrayBufferView<ArrayBufferLike>

options? ​

WriteFileOptions

Returns ​

void

pumpkin-plugins documentation