index.html
<!DOCTYPE html>
<html>
<head>
<title>index</title>
<meta charset="UTF-8"/>
<script src="./js/showdown.min.js"></script>
<script src="./js/showdown-prettify.min.js"></script>
<script src="./js/main.js"></script>
</head>
<body>
</body>
</html>
main.js
showdown.setFlavor('github');
var converter = new showdown.Converter({extensions: ['prettify']});
var input = "```js\n" +
"function add(a, b) { console.log(); }\n" +
"```";
var html = converter.makeHtml(input);
console.log(html);
output
<pre class="prettyprint linenums"><code class="js language-js">function add(a, b) { console.log(); }</code></pre>
index.html
main.js
output