From 6b8f1433347557076140afb35ef4d9f036a658f9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 9 Jan 2015 09:49:39 -0800 Subject: js/bench.js: use npm, added markdown-it. --- js/bench.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/js/bench.js b/js/bench.js index f23eb1a..77f5025 100644 --- a/js/bench.js +++ b/js/bench.js @@ -2,10 +2,12 @@ var Benchmark = require('benchmark').Benchmark; var suite = new Benchmark.Suite(); var fs = require('fs'); var sm = require('./lib/index.js'); -// https://github.com/coreyti/showdown -var showdown = require('../../showdown/src/showdown'); -// https://github.com/chjj/marked -var marked = require('../../marked/marked.min.js'); +// npm install showdown +var showdown = require('showdown'); +// npm install marked +var marked = require('marked'); +// npm install markdown-it +var markdownit = require('markdown-it')('commonmark'); var benchfile = process.argv[2]; @@ -29,6 +31,11 @@ suite.add('commonmark.js markdown->html', function() { marked(contents); }) +.add('markdown-it markdown->html', function() { + "use strict"; + markdownit.render(contents); +}) + .on('cycle', function(event) { "use strict"; console.log(String(event.target)); -- cgit v1.2.3