Module: nodeFs

Wrappers for "fs" module for node.js
Source:

Methods

(static) appendFile(ctx, path, data, options)

Wrapper for fs.appendFile (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
data ?
options Object
Source:
Throws:
Exception

(static) chmod(ctx, path, mode)

Wrapper for fs.chmod (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
mode ?
Source:
Throws:
Exception

(static) chown(ctx, path, uid, gid)

Wrapper for fs.chown (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
uid number
gid number
Source:
Throws:
Exception

(static) close(ctx, fd)

Wrapper for fs.close (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
fd number
Source:
Throws:
Exception

(static) fchmod(ctx, path, mode)

Wrapper for fs.fchmod (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
mode ?
Source:
Throws:
Exception

(static) fchown(ctx, path, uid, gid)

Wrapper for fs.fchown (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
uid number
gid number
Source:
Throws:
Exception

(static) lchmod(ctx, path, mode)

Wrapper for fs.lchmod (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
mode ?
Source:
Throws:
Exception

(static) lchown(ctx, path, uid, gid)

Wrapper for fs.lchown (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
uid number
gid number
Source:
Throws:
Exception
Wrapper for fs.link (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
existingPath String
newPath String
Source:
Throws:
Exception

(static) lstat(ctx, path) → {Object}

Wrapper for fs.lstat (node) Returns object with following properties - 'data' set to content of the stats of file
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
Source:
Throws:
Exception
Returns:
stats
Type
Object

(static) mkdir(ctx, path, mode)

Wrapper for fs.mkdir (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
mode number
Source:
Throws:
Exception

(static) mkdtemp(ctx, prefix, options)

Wrapper for fs.mkdtemp (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
prefix String
options Object
Source:
Throws:
Exception

(static) open(ctx, path, flags, mode)

Wrapper for fs.open (node) Returns object with following properties - 'data' set to fd
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
flags String
mode number
Source:
Throws:
Exception

(static) read(ctx, fd, buffer, offset, length, position)

Wrapper for fs.read (node) Returns object with following properties - 'data' set to data buffer - 'bytesRead' set to bytesRead
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
fd number
buffer ?
offset number
length number
position number
Source:
Throws:
Exception

(static) readdir(ctx, path, options) → {Object}

Wrapper for fs.readdir (node) Returns object with following properties - 'data' set to content of the dir in case of success - 'error' set to error in case of failure
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
options Object
Source:
Throws:
Exception
Returns:
dir content
Type
Object

(static) readFile(ctx, path, options) → {Object}

Wrapper for fs.readFile (node) Returns object with following properties - 'data' set to content of the file in case of success - 'error' set to error in case of failure
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
options Object
Source:
Throws:
Exception
Returns:
file content
Type
Object
Wrapper for fs.readlink (node) Returns object with following properties - 'data' set to content of the link in case of success - 'error' set to error in case of failure
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
options Object
Source:
Throws:
Exception
Returns:
link content
Type
Object

(static) realpath(ctx, path, options) → {Object}

Wrapper for fs.realpath (node) Returns object with following properties - 'data' set to content of the resolvedPath in case of success - 'error' set to error in case of failure
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
options Object
Source:
Throws:
Exception
Returns:
resolvedPath content
Type
Object

(static) rename(ctx, oldPath, newPath)

Wrapper for fs.rename (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
oldPath String
newPath String
Source:
Throws:
Exception

(static) rmdir(ctx, path)

Wrapper for fs.rmdir (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
Source:
Throws:
Exception

(static) stat(ctx, path) → {Object}

Wrapper for fs.stat (node) Returns object with following properties - 'data' set to content of the stats of file
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
Source:
Throws:
Exception
Returns:
stats
Type
Object
Wrapper for fs.symlink (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
target String
path String
type String
Source:
Throws:
Exception

(static) truncate(ctx, path, len)

Wrapper for fs.truncate (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
len number
Source:
Throws:
Exception
Wrapper for fs.unlink (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
Source:
Throws:
Exception

(static) utimes(ctx, path, atime, mtime)

Wrapper for fs.utimes (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
path String
atime String
mtime String
Source:
Throws:
Exception

(static) write(ctx, fd, buffer, offset, length, position)

Wrapper for fs.write (node) Returns object with following properties - 'data' set to data buffer - 'bytesRead' set to bytesRead
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
fd number
buffer ?
offset number
length number
position number
Source:
Throws:
Exception

(static) writeFile(ctx, file, data, options)

Wrapper for fs.writeFile (node)
Parameters:
Name Type Description
ctx State Context of nsynjs-executed caller, accessible via built-in variable
file String | buffer | number file path, descriptor or buffer to write to
data String | buffer | Uint8Array Data to write
options Object
Source:
Throws:
exception