---
title: "Discussion on \"Javascript: How to read and get data from an excel file\" | Hashnode"
description: "Discussion on \"Javascript: How to read and get data from an excel file\". For myself, I'm using this function\nasync function readDataFromExcel(file: File): Promise<any[]> {\n  return new Promise((resolve, reject) => {\n    const fileReader = new FileReader();\n    fileReader.onload = () => {\n      const arrayBuffer = <any> fi..."
url: "https://hashnode.com/posts/javascript-how-to-read-and-get-data-from-an-excel-file/610f1d58b79d6a11366822a9"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Javascript: How to read and get data from an excel file](https://trungnam.hashnode.dev/javascript-how-to-read-and-get-data-from-an-excel-file?utm_source=hashnode&utm_medium=feed)

For myself, I'm using this function async function readDataFromExcel(file: File): Promise<any\[\]> { return new Promise((resolve, reject) => { const fileReader = new FileReader(); fileReader.onload = () => { const arrayBuffer = <any> fi...

Aug 7, 2021 · 1 min read · trungnam.hashnode.dev  
Updated Jun 11, 2022  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#excel](https://hashnode.com/tag/excel)
-   [#help](https://hashnode.com/tag/help)

## Written by

[Trung Nam](https://hashnode.com/@trungnam)

@trungnam

  
[View profile](https://hashnode.com/@trungnam)

TrungNam

## Responses 1

Markdown supported · ⌘↵ to post

[Leon](https://hashnode.com/@LeonH)

[Aug 29, 2021](https://hashnode.com/posts/javascript-how-to-read-and-get-data-from-an-excel-file/610f1d58b79d6a11366822a9/comment/612ba13f2858872661b9b825)

I think SheetJS can read your `data` directly:

```
const workbook = XLSX.read(data, { type: 'array' });
```

[Trung Nam](https://hashnode.com/@trungnam)

[Aug 29, 2021](https://hashnode.com/posts/javascript-how-to-read-and-get-data-from-an-excel-file/610f1d58b79d6a11366822a9/comment/612ba13f2858872661b9b825#reply-612c0d6a2858872661b9c368)

I mean XLSX js, not SheetJS. You can find it on [npmjs.com/package/xlsx](https://www.npmjs.com/package/xlsx)
