@@ -146,6 +146,7 @@ <h2 id="table-of-contents">Table of contents</h2>
146146
147147< div id ="_content "> < h3 id ="synopsis "> Synopsis</ h3 >
148148< pre lang ="bash "> < code > npm fund [<pkg>]
149+ npm fund [-w <workspace-name>]
149150</ code > </ pre >
150151< h3 id ="description "> Description</ h3 >
151152< p > This command retrieves information on how to fund the dependencies of a
@@ -158,6 +159,33 @@ <h3 id="description">Description</h3>
158159< p > The list will avoid duplicated entries and will stack all packages that
159160share the same url as a single entry. Thus, the list does not have the same
160161shape of the output from < code > npm ls</ code > .</ p >
162+ < h4 id ="example "> Example</ h4 >
163+ < h3 id ="workspaces-support "> Workspaces support</ h3 >
164+ < p > It’s possible to filter the results to only include a single workspace and its
165+ dependencies using the < code > workspace</ code > config option.</ p >
166+ < h4 id ="example2 "> Example:</ h4 >
167+ < p > Here’s an example running < code > npm fund</ code > in a project with a configured
168+ workspace < code > a</ code > :</ p >
169+ < pre lang ="bash "> < code > $ npm fund
170+ 171+ +-- https://example.com/a
172+ 173+ | `-- https://example.com/maintainer
174+ 175+ +-- https://example.com/npmcli-funding
176+ | `-- @npmcli/test-funding
177+ `-- https://example.com/org
178+ 179+ </ code > </ pre >
180+ < p > And here is an example of the expected result when filtering only by
181+ a specific workspace < code > a</ code > in the same project:</ p >
182+ < pre lang ="bash "> < code > $ npm fund -w a
183+ 184+ `-- https://example.com/a
185+ 186+ `-- https://example.com/maintainer
187+ 188+ </ code > </ pre >
161189< h3 id ="configuration "> Configuration</ h3 >
162190< h4 id ="browser "> browser</ h4 >
163191< ul >
@@ -178,6 +206,22 @@ <h4 id="unicode">unicode</h4>
178206</ ul >
179207< p > Whether to represent the tree structure using unicode characters.
180208Set it to < code > false</ code > in order to use all-ansi output.</ p >
209+ < h4 id ="workspace "> < code > workspace</ code > </ h4 >
210+ < ul >
211+ < li > Default:</ li >
212+ < li > Type: String (can be set multiple times)</ li >
213+ </ ul >
214+ < p > Enable running a command in the context of the configured workspaces of the
215+ current project while filtering by running only the workspaces defined by
216+ this configuration option.</ p >
217+ < p > Valid values for the < code > workspace</ code > config are either:</ p >
218+ < ul >
219+ < li > Workspace names</ li >
220+ < li > Path to a workspace directory</ li >
221+ < li > Path to a parent workspace directory (will result to selecting all of the
222+ nested workspaces)</ li >
223+ </ ul >
224+ < p > This value is not exported to the environment for child processes.</ p >
181225< h4 id ="which "> which</ h4 >
182226< ul >
183227< li > Type: Number</ li >
@@ -190,6 +234,7 @@ <h2 id="see-also">See Also</h2>
190234< li > < a href ="../commands/npm-docs.html "> npm docs</ a > </ li >
191235< li > < a href ="../commands/npm-ls.html "> npm ls</ a > </ li >
192236< li > < a href ="../commands/npm-config.html "> npm config</ a > </ li >
237+ < li > < a href ="../using-npm/workspaces.html "> npm workspaces</ a > </ li >
193238</ ul >
194239</ div >
195240
0 commit comments