mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
8 lines
300 B
TypeScript
8 lines
300 B
TypeScript
import * as fs from 'bro-fs';
|
|
|
|
fs.init({type: window.TEMPORARY, bytes: 5 * 1024 * 1024})
|
|
.then(() => fs.mkdir('dir'))
|
|
.then(() => fs.writeFile('dir/file.txt', 'hello world'))
|
|
.then(() => fs.readFile('dir/file.txt', {type: 'Text'}))
|
|
.then(content => console.log(content)); // => "hello world"
|