Skip to content

Commit

Permalink
feat: use npm-registry-fetch instead of is-reachable (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber authored Sep 1, 2021
1 parent ce723ec commit 047de4e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 209 deletions.
4 changes: 2 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fs = require('graceful-fs');
const {spawnSync} = require('child_process');
const isReachable = require('is-reachable');
const npmFetch = require('npm-registry-fetch');
const prompts = require('prompts');
const {promisify} = require('util');
const writeJsonFile = require('write-json-file');
Expand All @@ -14,7 +14,7 @@ const MULTI_PUBLISH_FILE = '._multi-publish';
class Exit extends Error {}

async function waitTillReachable(registry) {
if (await isReachable(registry)) {
if (await npmFetch('/-/ping', {registry}).catch(() => false)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
},
"dependencies": {
"graceful-fs": "^4.2.4",
"is-reachable": "^5.0.0",
"meow": "^8.0.0",
"npm-registry-fetch": "^11.0.0",
"pacote": "^11.1.11",
"prompts": "^2.4.0",
"write-json-file": "^4.3.0"
Expand Down
Loading

0 comments on commit 047de4e

Please sign in to comment.