Skip to content

Commit e4ef186

Browse files
committed
docs: show complex object interactions in npm pkg
1 parent 7a85827 commit e4ef186

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 use text indices in square brackets
80+
to specifically select an 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)