Skip to content

Commit

Permalink
Use native Node.js ESM loader, drop esm package
Browse files Browse the repository at this point in the history
Node.js v13.2.0+ has ESM loader available unflagged.

Note the library can be used with Node.js v8+ using the esm package, but since
native ESM loader is only available in v13.2.0+, Travis tests only run on
v13/v14.
  • Loading branch information
chrisveness committed Apr 22, 2020
1 parent a7e676d commit 26b05fa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
language: node_js

node_js:
- "lts/*"
- "node"
- "8"
- "13"

os:
- linux
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ The library can be used in the browser by taking a local copy, or loading it fro

### Usage in Node.js

The library can be used in a Node.js app from [npm](https://www.npmjs.com/package/geodesy)
(currently the [esm](https://www.npmjs.com/package/esm) package is required to load ES-modules):
The library can be loaded from [npm](https://www.npmjs.com/package/geodesy) to be used in a Node.js app
(in Node.js v13.2.0+, or using the [esm](https://www.npmjs.com/package/esm) package in
v8.0.0–v12.15.0<sup title="v12.16.0+ is not compatible with esm@3.2.25">*</sup>):

```shell
$ npm install geodesy esm
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,19 @@
},
"bugs": "https://github.com/chrisveness/geodesy/issues",
"scripts": {
"test": "mocha --exit -r esm test/*.js",
"test": "mocha --exit test/*.js",
"lint": "eslint .",
"cover": "c8 -r html npm test",
"docs": "jsdoc *.js README.md -d ../../geodesy/docs"
},
"devDependencies": {
"babel-eslint": "^10.0.0",
"c8": "^7.0.0",
"chai": "^4.0.0",
"chai": "chaijs/chai#pull/1317/head",
"coveralls": "^3.0.0",
"eslint": "^6.0.0",
"esm": "^3.0.0",
"jsdoc": "^3.0.0",
"mocha": "^6.0.0"
"mocha": "^7.0.0"
},
"eslintConfig": {
"env": {
Expand Down

0 comments on commit 26b05fa

Please sign in to comment.