Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hackergrrl/docstrings
Interpret a string literal at the beginning of a function as its documentation.
https://github.com/hackergrrl/docstrings
Last synced: 24 days ago
JSON representation
Interpret a string literal at the beginning of a function as its documentation.
- Host: GitHub
- URL: https://github.com/hackergrrl/docstrings
- Owner: hackergrrl
- Created: 2016-08-13T17:40:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-15T17:28:48.000Z (over 8 years ago)
- Last Synced: 2024-10-10T16:08:53.292Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 16
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# docstrings
> Interpret a string literal at the beginning of a function as its
> documentation.## Usage
```js
var doc = require('docstrings')function foo () {
"returns foo"
return 'foo'
}console.log(doc(foo))
```This will output
```
returns foo
```## API
```js
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](https://npmjs.org/) installed, run
```
$ npm install docstrings
```## Acknowledgments
docstrings was inspired by clojure's approach to documenting functions.
## License
ISC