fs.append
fs.append
Function
Append the content to the end of the file.
Syntax
fs(path).append(content)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| content | Any | No | '' | Content to append; arrays and objects write JSON strings. |
Return value
| Type | Description |
|---|---|
| Int | Returns the number of bytes written this time. |
Example
file = fs('docs-append.txt') file.write('BT') result = file.append(' Lang') // Output: 5 print result
Notes
- File is created if it does not exist.