docstrings

0.2.1 • Public • Published

docstrings

Interpret a string literal at the beginning of a function as its documentation.

Usage

var doc = require('docstrings')
 
function foo () {
  "returns foo"
  return 'foo'
}
 
console.log(doc(foo))

This will output

returns foo

API

var doc = require('docstrings')

doc(func)

Returns a string matching the string literal at the beginning of a function. Matches "" and '' literals as well as template strings.

Install

With npm installed, run

$ npm install docstrings

Acknowledgments

docstrings was inspired by clojure's approach to documenting functions.

License

ISC

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.1
    5
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.1
    5
  • 0.2.0
    0
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i docstrings

Weekly Downloads

5

Version

0.2.1

License

ISC

Last publish

Collaborators

  • noffle