From caa016b19bb9fd96f4bbfb4b110149722d129233 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 27 Aug 2026 16:19:31 +0000 Subject: [PATCH 1/2] docs: add examples section to `_tools/pkgs/installed` README Populate the previously commented-out `## Examples` section in the README for `_tools/pkgs/installed`, transcribing the package's existing `examples/index.js` and rewriting the require path to the public package name. A JS-API-level Examples section is present in 24 of 25 (96%) sibling packages under `_tools/pkgs`; `installed` was the sole outlier, carrying an empty placeholder despite shipping a runnable example file. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01JsYoEEpvcPyy7QW4LTsyvD --- .../@stdlib/_tools/pkgs/installed/README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/_tools/pkgs/installed/README.md b/lib/node_modules/@stdlib/_tools/pkgs/installed/README.md index 5185d8a99e85..eafb2c77ebd9 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/installed/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/installed/README.md @@ -97,11 +97,22 @@ function onPkgs( error, list ) {
- -``` --> +```javascript +var pkgs = require( '@stdlib/_tools/pkgs/installed' ); + +pkgs( onPkgs ); + +function onPkgs( error, list ) { + if ( error ) { + throw error; + } + console.dir( list ); +} +```
From 5140fe6a76ccbd0440b6deaef3f27dc3d387fe91 Mon Sep 17 00:00:00 2001 From: Athan Date: Thu, 3 Sep 2026 18:37:42 -0700 Subject: [PATCH 2/2] Apply batched suggestions from code review Co-authored-by: Athan Signed-off-by: Athan --- lib/node_modules/@stdlib/_tools/pkgs/installed/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/node_modules/@stdlib/_tools/pkgs/installed/README.md b/lib/node_modules/@stdlib/_tools/pkgs/installed/README.md index eafb2c77ebd9..9834c18026c3 100644 --- a/lib/node_modules/@stdlib/_tools/pkgs/installed/README.md +++ b/lib/node_modules/@stdlib/_tools/pkgs/installed/README.md @@ -40,6 +40,8 @@ var pkgs = require( '@stdlib/_tools/pkgs/installed' ); Generates a list of installed package dependencies. + + ```javascript pkgs( onPkgs ); @@ -59,6 +61,8 @@ The function accepts the following `options`: By default, the function searches the entire package dependency tree. To limit the search depth, set the `depth` option. + + ```javascript var opts = { 'depth': 0 // search only top-level installed packages @@ -76,6 +80,8 @@ function onPkgs( error, list ) { To exclude development package dependencies, set the `dev` option to `false`. + + ```javascript var opts = { 'dev': false @@ -99,6 +105,8 @@ function onPkgs( error, list ) { ## Examples + + ```javascript