docs.sheetjs.com/docz/docs/02-getting-started/01-installation/07-bun.md

46 lines
1.3 KiB
Markdown
Raw Normal View History

2022-07-09 23:59:44 +00:00
---
2022-08-24 23:48:22 +00:00
pagination_prev: getting-started/index
pagination_next: getting-started/example
2022-07-09 23:59:44 +00:00
sidebar_position: 7
sidebar_custom_props:
summary: Download and Import ECMAScript Modules
---
import current from '/version.js';
# Bun
[Bun](https://bun.sh/) is a JavaScript runtime powered by JavaScriptCore.
:::caution Bun support is considered experimental.
Great open source software grows with user tests and reports. Any issues should
2022-08-19 02:26:17 +00:00
be reported to the Bun project for further diagnosis.
2022-07-09 23:59:44 +00:00
:::
Each standalone release script is available at <https://cdn.sheetjs.com/>.
<div><a href={`https://cdn.sheetjs.com/xlsx-${current}/package/xlsx.mjs`}>https://cdn.sheetjs.com/xlsx-{current}/package/xlsx.mjs</a> is the URL for {current}</div><br/>
After downloading the script, it can be directly imported:
```js
import * as XLSX from './xlsx.mjs';
2022-08-26 19:21:53 +00:00
import * as fs from 'fs';
XLSX.set_fs(fs);
2022-07-09 23:59:44 +00:00
```
2022-08-26 19:21:53 +00:00
## Encoding support
2022-07-09 23:59:44 +00:00
2022-08-26 19:21:53 +00:00
If Encoding support is required, `cpexcel.full.mjs` must be manually imported.
2022-07-09 23:59:44 +00:00
<div><a href={`https://cdn.sheetjs.com/xlsx-${current}/package/dist/cpexcel.full.mjs`}>https://cdn.sheetjs.com/xlsx-{current}/package/dist/cpexcel.full.mjs</a> is the URL for {current}</div><br/>
```ts
/* load the codepage support library for extended support with older formats */
import * as cptable from './cpexcel.full.mjs';
XLSX.set_cptable(cptable);
```