0.1.0 • Published 11 years ago
fn-docs v0.1.0
fn-docs
Quickly rip docs out of your functions by parsing comments.
Example
var fnDocs = require("fn-docs");
var parser = fnDocs();
var simpleFn = function(){
/*
1
2
3
*/
}
var docs = parser(simpleFn);
console.log(docs);Resulting in
1
2
3Options
fn-docs takes in one optional config object. This config object has three optional attributes, start, end, defaultDoc.
start
This optional config option defaults to /*. The first line this marker is found in (in any way) is marked as the line before the docs start.
/* this is not in the docs
but this isvar abc = 'abc'; /* none of this line is in the docs
but this isend
This optional config option defaults to *\. The first line this marker is found in (in any way) is marked as the line after the docs end.
This is in the docs
but this isn't */This is in the docs
but this isn't */ var abc = 'abc';defaultDoc
This optional config option defaults to null. It it used when ever start isn't found, end isn't found, or start and end have no space between them. If end is before start an error is thrown.
0.1.0
11 years ago