mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +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"
|