Skip to content

Commit 8091a3a

Browse files
committed
Change to use exports
1 parent 4e621cf commit 8091a3a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
],
2828
"sideEffects": false,
2929
"type": "module",
30-
"main": "index.js",
31-
"types": "index.d.ts",
30+
"exports": "./index.js",
3231
"files": [
3332
"lib/",
3433
"index.d.ts",

test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import test from 'node:test'
33
import {fromHtml} from 'hast-util-from-html'
4-
import {readingTime} from './index.js'
4+
import {readingTime} from 'hast-util-reading-time'
55

66
// https://simple.wikipedia.org/wiki/Reading
77
const somewhatSimple = `<p>Reading is what we do when we understand writing.</p>
@@ -29,9 +29,10 @@ const treeSomewhatSimple = fromHtml(somewhatSimple, {fragment: true})
2929

3030
test('readingTime', async function (t) {
3131
await t.test('should expose the public api', async function () {
32-
assert.deepEqual(Object.keys(await import('./index.js')).sort(), [
33-
'readingTime'
34-
])
32+
assert.deepEqual(
33+
Object.keys(await import('hast-util-reading-time')).sort(),
34+
['readingTime']
35+
)
3536
})
3637

3738
await t.test('should estimate (somewhat complex)', async function () {

0 commit comments

Comments
 (0)