Skip to content

Commit 5f59f80

Browse files
authored
docs: show complex object interactions in npm pkg (#4847)
1 parent 8fd7eec commit 5f59f80

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/content/commands/npm-pkg.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ Returned values are always in **json** format.
7676
npm pkg get contributors[0].email
7777
```
7878
79+
For complex fields you can also name a property in square brackets
80+
to specifically select a child field. This is especially helpful
81+
with the exports object:
82+
83+
```bash
84+
npm pkg get "exports[.].require"
85+
```
86+
7987
* `npm pkg set <field>=<value>`
8088
8189
Sets a `value` in your `package.json` based on the `field` value. When

0 commit comments

Comments
 (0)