Skip to content

[MAJOR VERSION] Move node v8 support to ES5 imports #1142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/exceljs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
# https://github.com/actions/setup-node/issues/27
node-version: [8.17.0, 10.x, 12.x, 13.x]
node-version: [8.17.0, 10.x, 12.x, 14.x]
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const ExcelJS = require('exceljs');

## ES5 Imports

To use the ES5 transpiled code, use the dist/es5 path.
To use the ES5 transpiled code, for example for node.js versions older than 10, use the dist/es5 path.

```javascript
const ExcelJS = require('exceljs/dist/es5');
Expand Down
6 changes: 5 additions & 1 deletion excel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
* or https://github.com/exceljs/exceljs/blob/master/LICENSE
*/

module.exports = require('./dist/es5');
if (parseInt(process.versions.node.split('.')[0], 10) < 10) {
throw new Error('For node versions older than 10, please use the ES5 Import: https://github.com/exceljs/exceljs#es5-imports');
}

module.exports = require('./lib/exceljs.nodejs.js');
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"engines": {
"node": ">=8.3.0"
},
"main": "./lib/exceljs.nodejs.js",
"main": "./excel.js",
"browser": "./dist/exceljs.min.js",
"types": "./index.d.ts",
"files": [
Expand Down Expand Up @@ -99,7 +99,7 @@
"proxyquire": "^2.1.3",
"readable-stream": "^3.6.0",
"saxes": "^5.0.1",
"tmp": "^0.1.0",
"tmp": "^0.2.0",
"unzipper": "^0.10.11",
"uuid": "^7.0.3"
},
Expand Down