https://github.com/joshgillies/function-stringify
Stringify functions, or more specifically their comments!
https://github.com/joshgillies/function-stringify
Last synced: 5 months ago
JSON representation
Stringify functions, or more specifically their comments!
- Host: GitHub
- URL: https://github.com/joshgillies/function-stringify
- Owner: joshgillies
- License: mit
- Created: 2015-09-24T11:10:59.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-07T09:34:42.000Z (over 9 years ago)
- Last Synced: 2025-02-07T03:16:28.432Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# function-stringify
Stringify functions, or more specifically their comments!
You know, because you might want a function body to store something other than just JavaScript.
[](https://travis-ci.org/joshgillies/function-stringify)
[](https://github.com/feross/standard)## Install
`npm install function-stringify`
## Example
```js
var fnStringify = require('function-stringify')var template = fnStringify(function () {/*
Welcome to The Internet
Hello, world!
*/}, true)console.log(template)
```## Usage
```js
var fnStringify = require('function-stringify')
```### fnStringify(fn, format)
`fn` is a function declaration whose body contains a comment block in the format of `/* content */`.
`format` is a boolean flag which when set to true `fnStringify` will attempt to preserve the formatting of the enclosed content string.
## License
MIT