Browse Source

Code cleanup

pull/979/head
Vitaly Puzrin 1 year 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
/* 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 = []

3
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()

3
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')

3
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)

Loading…
Cancel
Save