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