Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

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 6f537e1 commit a18ca15
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
12 changes: 5 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
'use strict'
import toString from 'mdast-util-to-string'
import visit from 'unist-util-visit'
import BananaSlug from 'github-slugger'

var toString = require('mdast-util-to-string')
var visit = require('unist-util-visit')
var slugs = require('github-slugger')()
const slugs = new BananaSlug()

module.exports = slug

function slug() {
export default function remarkSlug() {
return transformer
}

Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"Jayson Harshbarger <hypercubed@gmail.com>"
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"files": [
"index.js",
"types/index.d.ts"
"index.js"
],
"types": "types/index.d.ts",
"dependencies": {
"github-slugger": "^1.0.0",
"mdast-util-to-string": "^1.0.0",
Expand Down
12 changes: 5 additions & 7 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
'use strict'

var test = require('tape')
var remark = require('remark')
var u = require('unist-builder')
var removePosition = require('unist-util-remove-position')
var slug = require('.')
import test from 'tape'
import remark from 'remark'
import u from 'unist-builder'
import removePosition from 'unist-util-remove-position'
import slug from './index.js'

test('remark-slug', function (t) {
t.deepEqual(
Expand Down

0 comments on commit a18ca15

Please sign in to comment.