Updated specs
@@ -395,11 +395,11 @@ Read a file as JSON.
|
||||
api.readJSON(scope, filename, callback);
|
||||
```
|
||||
|
||||
| Argument | Type | Description |
|
||||
| -------- | --------------------------------- | ------------------------------------------------------------------------ |
|
||||
| scope | 'static' \| 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). |
|
||||
| filename | string | The name of the file. |
|
||||
| callback | ( json:any ):void | Function will be called with the JSON once it's loaded. |
|
||||
| Argument | Type | Description |
|
||||
| -------- | --------------------------------------------- | ------------------------------------------------------- |
|
||||
| scope | 'static' \| 'module' \| 'channel' \| 'static' | The scope of the file. |
|
||||
| filename | string | The name of the file. |
|
||||
| callback | ( json:any ):void | Function will be called with the JSON once it's loaded. |
|
||||
|
||||
### writeJSON
|
||||
|
||||
@@ -409,12 +409,12 @@ Write a file as JSON.
|
||||
api.writeJSON(scope, filename, json, callback?);
|
||||
```
|
||||
|
||||
| Argument | Type | Description |
|
||||
| ------------------- | --------------------- | ------------------------------------------------------------------------ |
|
||||
| scope | 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). |
|
||||
| filename | string | The name of the file. |
|
||||
| json | object | The JSON data to write. |
|
||||
| (Optional) callback | function | Function will be called with the JSON was saved. |
|
||||
| Argument | Type | Description |
|
||||
| ------------------- | --------------------------------- | ------------------------------------------------ |
|
||||
| scope | 'module' \| 'channel' \| 'static' | The scope of the file. |
|
||||
| filename | string | The name of the file. |
|
||||
| json | object | The JSON data to write. |
|
||||
| (Optional) callback | function | Function will be called with the JSON was saved. |
|
||||
|
||||
### writeFile
|
||||
|
||||
@@ -426,7 +426,7 @@ api.writeFile(scope, filename, data, options, callback?);
|
||||
|
||||
| Argument | Type | Description |
|
||||
| ------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
||||
| scope | 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). |
|
||||
| scope | 'module' \| 'channel' \| 'static' | The scope of the file. |
|
||||
| filename | string | The name of the file. |
|
||||
| data | string \| Buffer \| TypedArray \| DataView \| Object | The data to write. See [fs.writeFile](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). |
|
||||
| options | Object \| string | Writing options/mode to use. See [fs.writeFile](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). |
|
||||
@@ -440,11 +440,11 @@ Check if a file exists.
|
||||
api.fileExists(scope, filename, callback);
|
||||
```
|
||||
|
||||
| Argument | Type | Description |
|
||||
| -------- | --------------------------------- | ------------------------------------------------------------------------ |
|
||||
| scope | 'static' \| 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). |
|
||||
| filename | string | The name of the file. |
|
||||
| callback | ( exists:boolean ):void | Function will be called when the file exists check has finished. |
|
||||
| Argument | Type | Description |
|
||||
| -------- | --------------------------------------------- | ---------------------------------------------------------------- |
|
||||
| scope | 'static' \| 'module' \| 'channel' \| 'static' | The scope of the file. |
|
||||
| filename | string | The name of the file. |
|
||||
| callback | ( exists:boolean ):void | Function will be called when the file exists check has finished. |
|
||||
|
||||
### addHost
|
||||
|
||||
@@ -454,10 +454,10 @@ Make a file accessable through the webserver.
|
||||
api.addHost(scope, filename);
|
||||
```
|
||||
|
||||
| Argument | Type | Description |
|
||||
| -------- | --------------------- | ------------------------------------------------------------------------ |
|
||||
| scope | 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). |
|
||||
| filename | string | The name of the file. |
|
||||
| Argument | Type | Description |
|
||||
| -------- | --------------------------------- | ---------------------- |
|
||||
| scope | 'module' \| 'channel' \| 'static' | The scope of the file. |
|
||||
| filename | string | The name of the file. |
|
||||
|
||||
\*_Returns_ { hostID:string, relativeUrl:string, downloadUrl:string } _The data of the hosted file._
|
||||
|
||||
|
||||
Reference in New Issue
Block a user