Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joshgillies/function-stringify
Stringify functions, or more specifically their comments!
https://github.com/joshgillies/function-stringify
Last synced: 5 days 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 (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-07T09:34:42.000Z (almost 9 years ago)
- Last Synced: 2024-10-19T00:15:15.622Z (27 days 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.
[![Build Status](https://travis-ci.org/joshgillies/function-stringify.svg)](https://travis-ci.org/joshgillies/function-stringify)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](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