How to read xlsx file in javascript (browser)

SheetJS can be used to load an xlsx file in form view or any page…
the library will need to be added …through app_include_js/page_js/doctype_js as needed

new frappe.ui.FileUploader({
	as_dataurl: true,
	allow_multiple: false,
	on_success(file) {
		var reader = new FileReader();
		reader.onload = function (e) {
			var workbook =;
			var csv = XLSX.utils.sheet_to_csv(workbook.Sheets['Supplier Packing List Detail']);
			var data = frappe.utils.csv_to_array(csv);

			// add your logic here..