Browse Source

Code cleanup

pull/979/head
Vitaly Puzrin 6 months ago
parent
commit
e4a1712f64
  1. 11
      benchmark/benchmark.mjs
  2. 3
      benchmark/implementations/commonmark-reference/index.mjs
  3. 3
      benchmark/implementations/markdown-it-2.2.1-commonmark/index.mjs
  4. 3
      benchmark/implementations/marked/index.mjs

11
benchmark/benchmark.mjs

@ -1,13 +1,10 @@
#!/usr/bin/env node #!/usr/bin/env node
/* eslint no-console:0 */ /* eslint no-console:0 */
import { createRequire } from 'node:module' import fs from 'node:fs'
const require = createRequire(import.meta.url) import util from 'node:util'
import Benchmark from 'benchmark'
const fs = require('fs') import ansi from 'ansi'
const util = require('util')
const Benchmark = require('benchmark')
const ansi = require('ansi')
const cursor = ansi(process.stdout) const cursor = ansi(process.stdout)
const IMPLS = [] const IMPLS = []

3
benchmark/implementations/commonmark-reference/index.mjs

@ -1,7 +1,6 @@
import { createRequire } from 'node:module' 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 parser = new commonmark.Parser()
const renderer = new commonmark.HtmlRenderer() const renderer = new commonmark.HtmlRenderer()

3
benchmark/implementations/markdown-it-2.2.1-commonmark/index.mjs

@ -1,7 +1,6 @@
import { createRequire } from 'node:module' 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') const md = markdownit('commonmark')

3
benchmark/implementations/marked/index.mjs

@ -1,7 +1,6 @@
import { createRequire } from 'node:module' 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) { export function run (data) {
return marked(data) return marked(data)

Loading…
Cancel
Save