diff --git a/benchmark/benchmark.mjs b/benchmark/benchmark.mjs index 1fc4a93..982cf68 100755 --- a/benchmark/benchmark.mjs +++ b/benchmark/benchmark.mjs @@ -1,13 +1,10 @@ #!/usr/bin/env node /* eslint no-console:0 */ -import { createRequire } from 'node:module' -const require = createRequire(import.meta.url) - -const fs = require('fs') -const util = require('util') -const Benchmark = require('benchmark') -const ansi = require('ansi') +import fs from 'node:fs' +import util from 'node:util' +import Benchmark from 'benchmark' +import ansi from 'ansi' const cursor = ansi(process.stdout) const IMPLS = [] diff --git a/benchmark/implementations/commonmark-reference/index.mjs b/benchmark/implementations/commonmark-reference/index.mjs index 65505b7..1e9b452 100644 --- a/benchmark/implementations/commonmark-reference/index.mjs +++ b/benchmark/implementations/commonmark-reference/index.mjs @@ -1,7 +1,6 @@ import { createRequire } from 'node:module' -const require = createRequire(import.meta.url) -const commonmark = require('../../extra/lib/node_modules/commonmark') +const commonmark = createRequire(import.meta.url)('../../extra/lib/node_modules/commonmark') const parser = new commonmark.Parser() const renderer = new commonmark.HtmlRenderer() diff --git a/benchmark/implementations/markdown-it-2.2.1-commonmark/index.mjs b/benchmark/implementations/markdown-it-2.2.1-commonmark/index.mjs index 6af5567..4b9f18b 100644 --- a/benchmark/implementations/markdown-it-2.2.1-commonmark/index.mjs +++ b/benchmark/implementations/markdown-it-2.2.1-commonmark/index.mjs @@ -1,7 +1,6 @@ import { createRequire } from 'node:module' -const require = createRequire(import.meta.url) -const markdownit = require('../../extra/lib/node_modules/markdown-it') +const markdownit = createRequire(import.meta.url)('../../extra/lib/node_modules/markdown-it') const md = markdownit('commonmark') diff --git a/benchmark/implementations/marked/index.mjs b/benchmark/implementations/marked/index.mjs index 9c9ba76..ac4e1e2 100644 --- a/benchmark/implementations/marked/index.mjs +++ b/benchmark/implementations/marked/index.mjs @@ -1,7 +1,6 @@ import { createRequire } from 'node:module' -const require = createRequire(import.meta.url) -const marked = require('../../extra/lib/node_modules/marked') +const marked = createRequire(import.meta.url)('../../extra/lib/node_modules/marked') export function run (data) { return marked(data)