fn-docs
parse docs out of a function
Last updated 5 years ago by mcwhittemore .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fn-docs 
SYNC missed versions from official npm registry.

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
3

Options

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 is
var abc = 'abc'; /* none of this line is in the docs
but this is

end

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.

Current Tags

  • 0.1.0                                ...           latest (5 years ago)

1 Versions

  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |