Skip to content

Commit

Permalink
Use ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 30, 2021
1 parent af6dc93 commit fba7e39
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
10 changes: 3 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
'use strict'
import doctypes from 'doctype'
import h from 'hastscript'

var doctypes = require('doctype')
var h = require('hastscript')

module.exports = document

function document(options) {
export default function document(options) {
var settings = options || {}
var meta = cast(settings.meta)
var link = cast(settings.link)
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
"contributors": [
"Titus Wormer <[email protected]> (https://wooorm.com)"
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"files": [
"index.js",
"types/index.d.ts"
"index.js"
],
"types": "types/index.d.ts",
"dependencies": {
"@types/hast": "^2.0.0",
"doctype": "^2.0.0",
Expand Down Expand Up @@ -63,6 +64,10 @@
"xo": {
"prettier": true,
"esnext": false,
"rules": {
"no-var": "off",
"prefer-arrow-callback": "off"
},
"ignores": [
"**/*.ts"
]
Expand Down
8 changes: 3 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict'

var test = require('tape')
var rehype = require('rehype')
var document = require('.')
import test from 'tape'
import rehype from 'rehype'
import document from './index.js'

test('document()', function (t) {
t.equal(
Expand Down

0 comments on commit fba7e39

Please sign in to comment.