fslockjs
Version:
Easy to use file system queue with locking and events. Provide Asynchronous utilities for Directories and File
58 lines (37 loc) • 986 B
Markdown
```js
await File.append('myfile.txt', 'Sincerely, The End.');
```
```js
await File.append('myfile.json', {name:'Alex'});
```
```js
await File.create('myfile.txt', 'Hello FS World.');
```
Used to download a file over http or https.
- outputPath - Not required, when provided, will store at the requested location.
```js
const uri = 'http://w3c.github.io/csvw/tests/test001.json';
const data = await File.download(uri);
await File.download(uri, 'test0001.json');
```
```js
await File.ensure('myfile.txt');
```
```js
await File.exists('myfile.txt');
```
```js
await File.read('myfile.txt');
```
```js
await File.remove('myfile.txt');
```