Skip to content

Commit f926b3d

Browse files
committed
Add lint example
1 parent 375e800 commit f926b3d

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

docs/NODE_API.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,22 @@ of lint information intended for human-readable output.
108108
- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** to be called when the documentation generation
109109
is complete, with (err, result) arguments
110110

111+
**Examples**
112+
113+
```javascript
114+
documentation.lint('file.js', {}, function (err, lintOutput) {
115+
if (err) {
116+
throw err;
117+
}
118+
if (lintOutput) {
119+
console.log(lintOutput);
120+
process.exit(1);
121+
} else {
122+
process.exit(0);
123+
}
124+
});
125+
```
126+
111127
Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** calls callback
112128

113129
# formats

index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,18 @@ function buildSync(indexes, options) {
225225
* is complete, with (err, result) arguments
226226
* @returns {undefined} calls callback
227227
* @public
228+
* @example
229+
* documentation.lint('file.js', {}, function (err, lintOutput) {
230+
* if (err) {
231+
* throw err;
232+
* }
233+
* if (lintOutput) {
234+
* console.log(lintOutput);
235+
* process.exit(1);
236+
* } else {
237+
* process.exit(0);
238+
* }
239+
* });
228240
*/
229241
function lint(indexes, options, callback) {
230242
options = options || {};

0 commit comments

Comments
 (0)