<script src="https://jc3213.github.io/promisefilereader.js/filereader.js"></script>// @require https://jc3213.github.io/promisefilereader.js/filereader.jslet testResult = await PromiseFileReader.text(file);- textResult
- Promise object, which returns text contents of the file as
stringif fulfilled
- Promise object, which returns text contents of the file as
let jsonResult = await PromiseFileReader.json(file);- jsonResult
- Promise object, which returns the contents of the file as a
JSONobject if fulfilled
- Promise object, which returns the contents of the file as a
let dataResult = await PromiseFileReader.dataURL(file);- dataResult
- Promise object, which returns a
data:URL representing the file's content if fulfilled
- Promise object, which returns a
let base64Result = await PromiseFileReader.base64(file);- base64Result
- Promise object, which returns base64 encoded
stringof the file's content if fulfilled
- Promise object, which returns base64 encoded
let bufferResult = await PromiseFileReader.arrayBuffer(file);- bufferResult
- Promise object, which returns an
ArrayBufferrepresenting the file's content if fulfilled
- Promise object, which returns an
let binaryResult = await PromiseFileReader.binaryString(file);- binaryResult
- Promise object, which returns the raw binary
stringdata of the file's content if fulfilled
- Promise object, which returns the raw binary