Skip to content

Commit 17a0701

Browse files
committed
fix: update README examples to match stdlib async pattern
1 parent 902ad9d commit 17a0701

File tree

1 file changed

+7
-12
lines changed
  • lib/node_modules/@stdlib/_tools/static-analysis/js/summarize-file-list

1 file changed

+7
-12
lines changed

lib/node_modules/@stdlib/_tools/static-analysis/js/summarize-file-list/README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,16 @@ var analyze = require( '@stdlib/_tools/static-analysis/js/summarize-file-list' )
4747
Performs a static [summary analysis][@stdlib/_tools/static-analysis/js/incr/program-summary] for a list of JavaScript files.
4848

4949
```javascript
50-
var files = [ '/foo/bar/beep.js', '/foo/bar/boop.js' ];
50+
var files = [ './beep.js', './boop.js' ];
51+
52+
analyze( files, clbk );
5153

5254
function clbk( error, results ) {
5355
if ( error ) {
5456
throw error;
5557
}
5658
console.log( JSON.stringify( results ) );
5759
}
58-
59-
analyze( files, clbk );
60-
// throws <Error>
6160
```
6261

6362
The function accepts the following `options`:
@@ -67,34 +66,30 @@ The function accepts the following `options`:
6766
By default, the function performs a cumulative static [summary analysis][@stdlib/_tools/static-analysis/js/incr/program-summary]. To return a separate [program summary][@stdlib/_tools/static-analysis/js/program-summary] for each file in `files`, set the `cumulative` option to `false`.
6867

6968
```javascript
70-
var files = [ '/foo/bar/beep.js', '/foo/bar/boop.js' ];
69+
var files = [ './beep.js', './boop.js' ];
7170

7271
var opts = {
7372
'cumulative': false
7473
};
7574

75+
analyze( files, opts, clbk );
76+
7677
function clbk( error, results ) {
7778
if ( error ) {
7879
throw error;
7980
}
8081
console.log( JSON.stringify( results ) );
8182
}
82-
83-
analyze( files, opts, clbk );
84-
// throws <Error>
85-
8683
```
8784

8885
#### analyze.sync( files\[, options] )
8986

9087
Synchronously performs a static [summary analysis][@stdlib/_tools/static-analysis/js/incr/program-summary] for a list of JavaScript files.
9188

9289
```javascript
93-
var files = [ '/foo/bar/beep.js', '/foo/bar/boop.js' ];
90+
var files = [ './beep.js', './boop.js' ];
9491

9592
var results = analyze.sync( files );
96-
// throws <Error>
97-
9893
if ( results instanceof Error ) {
9994
throw results;
10095
}

0 commit comments

Comments
 (0)