Skip to content

Commit

Permalink
Use ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 6, 2021
1 parent d084a11 commit 1264a38
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
8 changes: 2 additions & 6 deletions index.js
@@ -1,10 +1,6 @@
'use strict'
import util from 'mdast-util-toc'

var util = require('mdast-util-toc')

module.exports = toc

function toc(options = {}) {
export default function remarkToc(options = {}) {
return transformer

function transformer(node) {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -33,9 +33,10 @@
"Jonathan Haines <jonno.haines@gmail.com>",
"Robin Millette <robin@millette.info>"
],
"types": "types/index.d.ts",
"sideEffects": false,
"type": "module",
"main": "index.js",
"files": [
"types/index.d.ts",
"index.js"
],
"dependencies": {
Expand Down
16 changes: 7 additions & 9 deletions test/index.js
@@ -1,14 +1,12 @@
'use strict'

var fs = require('fs')
var path = require('path')
var test = require('tape')
var remark = require('remark')
var hidden = require('is-hidden')
var toc = require('..')
import fs from 'fs'
import path from 'path'
import test from 'tape'
import remark from 'remark'
import hidden from 'is-hidden'
import toc from '../index.js'

test('Fixtures', function (t) {
var root = path.join(__dirname, 'fixtures')
var root = path.join('test', 'fixtures')
var fixtures = fs.readdirSync(root)
var index = -1
var fixture
Expand Down

0 comments on commit 1264a38

Please sign in to comment.