MCPcopy Index your code
hub / github.com/nodejs/node / packagesChangedMessage

Function packagesChangedMessage

deps/npm/lib/utils/reify-output.js:176–220  ·  view source on GitHub ↗
(npm, { added, removed, changed, audited })

Source from the content-addressed store, hash-verified

174}
175
176const packagesChangedMessage = (npm, { added, removed, changed, audited }) => {
177 const msg = ['\n']
178 if (added === 0 && removed === 0 && changed === 0) {
179 msg.push('up to date')
180 if (audited) {
181 msg.push(', ')
182 }
183 } else {
184 if (added) {
185 msg.push(`added ${added} package${added === 1 ? '' : 's'}`)
186 }
187
188 if (removed) {
189 if (added) {
190 msg.push(', ')
191 }
192
193 if (added && !audited && !changed) {
194 msg.push('and ')
195 }
196
197 msg.push(`removed ${removed} package${removed === 1 ? '' : 's'}`)
198 }
199 if (changed) {
200 if (added || removed) {
201 msg.push(', ')
202 }
203
204 if (!audited && (added || removed)) {
205 msg.push('and ')
206 }
207
208 msg.push(`changed ${changed} package${changed === 1 ? '' : 's'}`)
209 }
210 if (audited) {
211 msg.push(', and ')
212 }
213 }
214 if (audited) {
215 msg.push(`audited ${audited} package${audited === 1 ? '' : 's'}`)
216 }
217
218 msg.push(` in ${ms(Date.now() - npm.started)}`)
219 output.standard(msg.join(''))
220}
221
222const packagesFundingMessage = (npm, { funding }) => {
223 if (!funding) {

Callers 1

reifyOutputFunction · 0.85

Calls 4

msFunction · 0.85
nowMethod · 0.80
pushMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…