Warning! This demo cannot work on Internet explorer. Please try Google Chrome or Mozilla Firefox or Opera.

What is jsdoctypeparser?

jsdoctypeparser is a Jsdoc type expression parser module. This module makes easy to publish a type name link by toHTML(). It helps you to develop your template. This module is available on github or npm.

This module can parse:

JsDoc type expressions
foo.bar, String[], module:foo/bar
Closure Compiler type expressions
Array.<string>, function(this: Object, arg1, arg2): ret
Complex type expressions
Array.<Array.<string>>, function(function(Function))

Let's try!


Complete parsing!

Syntax Error


				

Any questions?

Please ask @orga_chem on Twitter.

Result

Parsing

var jsdoctypeparser = require('jsdoctypeparser');
var parser = new jsdoctypeparser.Parser();
var result = parser.parse(yourTypeExpression);
console.log(result);

The console output is:


				

Publishing

toString()
console.log(result.toString());

				
toHtml()
console.log(result.toHtml());