File tree Expand file tree Collapse file tree 4 files changed +9
-11
lines changed Expand file tree Collapse file tree 4 files changed +9
-11
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 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" : {
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 },
6665 "xo" : {
6766 "prettier" : true ,
6867 "esnext" : false ,
69- "extensions" : [
70- " mjs"
71- ],
7268 "rules" : {
7369 "complexity" : " off" ,
7470 "eqeqeq" : [
Original file line number Diff line number Diff line change @@ -41,9 +41,11 @@ be imported instead of required.
4141npm 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
4951import {sitemap } from ' xast-util-sitemap'
@@ -66,7 +68,7 @@ var tree = sitemap([
6668console .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" ?>
Original file line number Diff line number Diff line change 11'use strict'
22
33import test from 'tape'
4- import { sitemap } from './index.mjs '
4+ import { sitemap } from './index.js '
55
66test ( 'sitemap' , function ( t ) {
77 t . deepEqual (
You can’t perform that action at this time.
0 commit comments