nodejs/deps/npm/lib/utils/ping.js
npm CLI robot 25b22e4754
deps: upgrade npm to 11.0.0
PR-URL: https://github.com/nodejs/node/pull/56274
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-01-10 16:20:27 +00:00

8 lines
268 B
JavaScript

// ping the npm registry
// used by the ping and doctor commands
const npmFetch = require('npm-registry-fetch')
module.exports = async (flatOptions) => {
const res = await npmFetch('/-/ping', { ...flatOptions, cache: false })
return res.json().catch(() => ({}))
}