Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 986 Bytes

File.md

File metadata and controls

57 lines (37 loc) · 986 Bytes

File API

async File.append(path, data)

    await File.append('myfile.txt', 'Sincerely, The End.');

async File.appendJSON(path, data ={})

    await File.append('myfile.json', {name:'Alex'});

async File.create(path, [data=''])

    await File.create('myfile.txt', 'Hello FS World.');

async File.download(uri, [outputPath])

Used to download a file over http or https.

  • outputPath - Not required, when provided, will store at the requested location.
    const uri = 'http://w3c.github.io/csvw/tests/test001.json';
    const data = await File.download(uri);

    await File.download(uri, 'test0001.json');

async File.ensure(path)

    await File.ensure('myfile.txt');

async File.exists(path)

    await File.exists('myfile.txt');

async File.read(path)

    await File.read('myfile.txt');

async File.remove(path)

    await File.remove('myfile.txt');