Skip to content

Commit e295e6b

Browse files
committed
Refactor to use js as extension
1 parent 84d6955 commit e295e6b

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed
File renamed without changes.

package.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@
2323
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
2424
],
2525
"type": "module",
26-
"main": "./index.mjs",
27-
"module": "./index.mjs",
26+
"module": "./index.js",
2827
"types": "types",
2928
"files": [
30-
"index.mjs",
29+
"index.js",
3130
"types/index.d.ts"
3231
],
3332
"dependencies": {
@@ -50,8 +49,8 @@
5049
},
5150
"scripts": {
5251
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
53-
"test-api": "node test.mjs",
54-
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node --experimental-modules test.mjs",
52+
"test-api": "node test.js",
53+
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node --experimental-modules test.js",
5554
"test-types": "dtslint types",
5655
"test": "npm run format && npm run test-coverage && npm run test-types"
5756
},
@@ -66,9 +65,6 @@
6665
"xo": {
6766
"prettier": true,
6867
"esnext": false,
69-
"extensions": [
70-
"mjs"
71-
],
7268
"rules": {
7369
"complexity": "off",
7470
"eqeqeq": [

readme.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ be imported instead of required.
4141
npm install xast-util-sitemap
4242
```
4343

44+
Note that this package is ESM only: it must be imported instead of required.
45+
4446
## Use
4547

46-
Say we have the following module, `example.mjs`
48+
Say we have the following module, `example.js`
4749

4850
```js
4951
import {sitemap} from 'xast-util-sitemap'
@@ -66,7 +68,7 @@ var tree = sitemap([
6668
console.log(toXml(tree))
6769
```
6870

69-
Now, running `node example.mjs` yields (pretty printed):
71+
Now, running `node example.js` yields (pretty printed):
7072

7173
```xml
7274
<?xml version="1.0" encoding="utf-8"?>

test.mjs renamed to test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

33
import test from 'tape'
4-
import {sitemap} from './index.mjs'
4+
import {sitemap} from './index.js'
55

66
test('sitemap', function (t) {
77
t.deepEqual(

0 commit comments

Comments
 (0)