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