Skip to content

Commit 86ffd64

Browse files
committed
Update docs and use utility to resolve root search directory
1 parent f61a8d0 commit 86ffd64

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

lib/node_modules/@stdlib/_tools/pkgs/names/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function onList( error, names ) {
4747

4848
The function accepts the following `options`:
4949

50-
- **dir**: root directory from which to search for packages. May be either an absolute path or a path relative to the `stdlib/lib/node_modules/` directory. Default: `/path/to/stdlib/lib/node_modules/`.
50+
- **dir**: directory from which to search for packages. May be either an absolute path or a path relative to the `stdlib/lib/node_modules/` directory. Default: `/path/to/stdlib/lib/node_modules/`.
5151
- **pattern**: glob pattern used to find packages. Default: `'**/package.json'` (note: pattern **must** end with `package.json`).
5252
- **ignore**: list of glob patterns used to exclude matches.
5353

@@ -185,7 +185,7 @@ Options:
185185

186186
### Notes
187187

188-
- If not provided a `dir` argument, the search directory is the current working directory.
188+
- If not provided a `dir` argument, the search directory is the top-level `stdlib` package directory.
189189

190190
- To provide multiple exclusion glob patterns, set multiple `--ignore` option arguments.
191191

lib/node_modules/@stdlib/_tools/pkgs/names/lib/async.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var getRoot = require( './root.js' );
3535
* Asynchronously generates a list of stdlib package names.
3636
*
3737
* @param {Options} [options] - function options
38-
* @param {string} [options.dir] - root directory from which to search for packages
38+
* @param {string} [options.dir] - directory from which to search for packages
3939
* @param {string} [options.pattern='**\/package.json'] - glob pattern
4040
* @param {StringArray} [options.ignore] - glob pattern(s) to exclude matches
4141
* @param {Callback} clbk - callback to invoke after finding packages

lib/node_modules/@stdlib/_tools/pkgs/names/lib/root.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
// MODULES //
2222

2323
var resolve = require( 'path' ).resolve;
24+
var rootDir = require( '@stdlib/_tools/utils/root-dir' );
2425

2526

2627
// VARIABLES //
2728

28-
var ROOT = resolve( __dirname, './../../../../../' );
29+
var ROOT = resolve( rootDir(), 'lib', 'node_modules' );
2930

3031

3132
// MAIN //

lib/node_modules/@stdlib/_tools/pkgs/names/lib/sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var getRoot = require( './root.js' );
3434
* Synchronously generates a list of stdlib package names.
3535
*
3636
* @param {Options} [options] - function options
37-
* @param {string} [options.dir] - root directory from which to search for packages
37+
* @param {string} [options.dir] - directory from which to search for packages
3838
* @param {string} [options.pattern='**\/package.json'] - glob pattern
3939
* @param {StringArray} [options.ignore] - glob pattern(s) to exclude matches
4040
* @throws {TypeError} options argument must be an object

0 commit comments

Comments
 (0)