Skip to main content
Version: 1.x

FileBlock

Extends​

Constructors​

Constructor​

new FileBlock(filename, content, start, end, tag, options?): FileBlock

Parameters​

ParameterType

filename

string

content

string

start

string

end

string

tag

string

options?

FileOptions

Returns​

FileBlock

Overrides​

File.constructor

Properties​

PropertyModifierTypeDefault valueInherited from

content

public

string

undefined

File.content

end

public

string

undefined

‐

filename

public

string

undefined

File.filename

persisted

public

boolean

false

File.persisted

start

public

string

undefined

‐

tag

public

string

undefined

File.tag

Methods​

addBlockToContent()​

protected addBlockToContent(existingContent): string

Parameters​

ParameterType

existingContent

string

Returns​

string


buildContent()​

protected buildContent(): Promise<string>

Returns​

Promise<string>

Inherited from​

File.buildContent


buildHeader()​

protected buildHeader(): string

Returns​

string

Inherited from​

File.buildHeader


buildPadding()​

protected buildPadding(existingContent): "" | "\n" | "\n\n"

Parameters​

ParameterType

existingContent

string

Returns​

"" | "\n" | "\n\n"


createComment()​

protected createComment(comment): string

Parameters​

ParameterType

comment

string

Returns​

string

Inherited from​

File.createComment


getExistingContent()​

protected getExistingContent(): Promise<readonly [string, FileHandle] | readonly ["", null]>

Returns​

Promise<readonly [string, FileHandle] | readonly ["", null]>


getSlices()​

protected getSlices(existingContent): readonly [string, "", false] | readonly [string, string, true]

Parameters​

ParameterType

existingContent

string

Returns​

readonly [string, "", false] | readonly [string, string, true]


unlink(): Promise<void>

Returns​

Promise<void>

Overrides​

File.unlink


write()​

write(): Promise<void>

Returns​

Promise<void>

Overrides​

File.write