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 |
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 |
? |
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 |
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 |
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 |
? |
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 |
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 |
? |
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 |
Throws:
Exception
(static) link(ctx, existingPath, newPath)
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Throws:
Exception
Returns:
file content
- Type
- Object
(static) readlink(ctx, path, options) → {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 |
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 |
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 |
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 |
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 |
Throws:
Exception
Returns:
stats
- Type
- Object
(static) symlink(ctx, target, path, type)
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 |
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 |
Throws:
Exception
(static) unlink(ctx, path)
Wrapper for fs.unlink (node)
Parameters:
Name | Type | Description |
---|---|---|
ctx |
State | Context of nsynjs-executed caller, accessible via built-in variable |
path |
String |
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 |
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 |
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 |
Throws:
exception