Skip to content

Commit

Permalink
Add description for comment option at README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fossamagna committed Dec 19, 2018
1 parent 8d2a0c4 commit 18906c8
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ $ npm install gas-entry-generator --save-dev

foo.js:
```js
/**
* comment for foo function.
*/
global.foo = function () {
};
```
Expand All @@ -27,8 +30,20 @@ var fs = require('fs');
var gasEntryGenerator = require('gas-entry-generator');

var fooSource = fs.readFileSync('foo.js', {encoding: 'utf8'});
var entryFunction = gasEntryGenerator(fooSource);
console.log(entryFunction); // entryFunction is "function foo() {}"
var options = {
comment: true
};
var entryFunction = gasEntryGenerator(fooSource, options);
console.log(entryFunction);
```

Console output:
```js
/**
* comment for foo function.
*/
function foo() {
}
```

Execute to generate function as entry point.
Expand Down

0 comments on commit 18906c8

Please sign in to comment.