Home Reference Source Repository

Function

Static Public Summary
public

From a normalized input file name, return the file name string.

public

lstatRx(input: object | string): Observable<object>

Get stats for a file (including symbolic links)

public

mkdirpRx(input: string, options: string): Observable<object>

Make directories, including all that don't exist.

public

normalizeInput(input: string | object): object

Normalize an input file name

public

readFileRx(input: object | string, options: string): Observable<object>

Read the contents of a file.

public

renameRx(input: object | string, newPath: string): Observable<object>

Rename or move a file or directory.

public

rimrafRx(input: string, options: object): Observable<object>

Use rimraf to delete all files and directories.

public

statRx(input: object | string): Observable<object>

Get stats for a file.

public

unlinkRx(input: object | string): Observable<object>

Delete a file.

public

writeFileRx(input: object | string, content: string | Buffer, options: string): Observable<object>

Write the contents of a file.

Static Public

public fileNameOf(input: object): string source

import {fileNameOf} from 'fs-rx/src/normalize-input.js'

From a normalized input file name, return the file name string.

Params:

NameTypeAttributeDescription
input object

A normalized file name with a basedir and name property.

Return:

string

The file name.

public lstatRx(input: object | string): Observable<object> source

import {lstatRx} from 'fs-rx/src/stat-file.js'

Get stats for a file (including symbolic links)

Params:

NameTypeAttributeDescription
input object | string

The file name to obtain stats for.

Return:

Observable<object>

An observable containing the file name object that includes a stats property with the stats obtained. The stats will be for the symbolic link (using lstat) if applicable.

public mkdirpRx(input: string, options: string): Observable<object> source

import {mkdirpRx} from 'fs-rx/src/mkdirp-path.js'

Make directories, including all that don't exist.

Params:

NameTypeAttributeDescription
input string

The directory to create, including any intermediate directories.

options string

Options (not required) that are passed to the mkdirp function.

Return:

Observable<object>

An observable containing an empty object.

public normalizeInput(input: string | object): object source

import {normalizeInput} from 'fs-rx/src/normalize-input.js'

Normalize an input file name

Params:

NameTypeAttributeDescription
input string | object

Either a file name (relative to the current working directory) or an object with a basedir and name property (like what is returned from the globRx function).

Return:

object

A normalized object with a name and basedir property.

public readFileRx(input: object | string, options: string): Observable<object> source

import {readFileRx} from 'fs-rx/src/read-file.js'

Read the contents of a file.

Params:

NameTypeAttributeDescription
input object | string

The file name to read.

options string

Options (not required) that are passed to the readFile function.

Return:

Observable<object>

An observable containing the file name object that includes either a content property (for string contents) or a buffer property (if the file is read as as Node Buffer object).

public renameRx(input: object | string, newPath: string): Observable<object> source

import {renameRx} from 'fs-rx/src/rename-file.js'

Rename or move a file or directory.

Params:

NameTypeAttributeDescription
input object | string

The file or directory name to rename.

newPath string

The path to rename to.

Return:

Observable<object>

An observable containing the file name object, where the name is derived from the newPath relative to the basedir.

public rimrafRx(input: string, options: object): Observable<object> source

import {rimrafRx} from 'fs-rx/src/rimraf-path.js'

Use rimraf to delete all files and directories.

Params:

NameTypeAttributeDescription
input string

The file or directory name to delete.

options object

Options (not required) that are passed to the rimraf function.

Return:

Observable<object>

An observable containing an empty object.

public statRx(input: object | string): Observable<object> source

import {statRx} from 'fs-rx/src/stat-file.js'

Get stats for a file.

Params:

NameTypeAttributeDescription
input object | string

The file name to obtain stats for.

Return:

Observable<object>

An observable containing the file name object that includes a stats property with the stats obtained.

public unlinkRx(input: object | string): Observable<object> source

import {unlinkRx} from 'fs-rx/src/unlink-file.js'

Delete a file.

Params:

NameTypeAttributeDescription
input object | string

The file name to delete.

Return:

Observable<object>

An observable containing the file information object.

public writeFileRx(input: object | string, content: string | Buffer, options: string): Observable<object> source

import {writeFileRx} from 'fs-rx/src/write-file.js'

Write the contents of a file.

Params:

NameTypeAttributeDescription
input object | string

The file name to write.

content string | Buffer

Data to write.

options string

Options (not required) that are passed to the writeFile function.

Return:

Observable<object>

An observable containing the file name object.