files/en-us/web/api/filereader/readystate/index.md
{{APIRef("File API")}}{{AvailableInWorkers}}
The readyState read-only property of the {{domxref("FileReader")}} interface provides the current state of the reading operation.
This will be one of the states: EMPTY, LOADING, or DONE.
A number which is one of the three possible state constants defined on the {{domxref("FileReader")}} interface:
FileReader.EMPTY (0)
FileReader.LOADING (1)
FileReader.DONE (2)
const reader = new FileReader();
console.log("EMPTY", reader.readyState); // readyState will be 0
reader.readAsText(blob);
console.log("LOADING", reader.readyState); // readyState will be 1
reader.onloadend = () => {
console.log("DONE", reader.readyState); // readyState will be 2
};
{{Specifications}}
{{Compat}}