From 5f59f803d1c6cdc690d4d7016990ca0e20c6706f Mon Sep 17 00:00:00 2001 From: Gar Date: Tue, 3 May 2022 16:55:09 -0700 Subject: [PATCH] docs: show complex object interactions in npm pkg (#4847) --- docs/content/commands/npm-pkg.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/content/commands/npm-pkg.md b/docs/content/commands/npm-pkg.md index 576e1335efbba..deff7e82c694d 100644 --- a/docs/content/commands/npm-pkg.md +++ b/docs/content/commands/npm-pkg.md @@ -76,6 +76,14 @@ Returned values are always in **json** format. npm pkg get contributors[0].email ``` + For complex fields you can also name a property in square brackets + to specifically select a child field. This is especially helpful + with the exports object: + + ```bash + npm pkg get "exports[.].require" + ``` + * `npm pkg set =` Sets a `value` in your `package.json` based on the `field` value. When