1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const fs = require("fs-extra");
|
4 | const http_call_1 = require("http-call");
|
5 | async function touch(file) {
|
6 | if (!await fs.pathExists(file)) {
|
7 | await fs.outputJSON(file, {});
|
8 | }
|
9 | else {
|
10 | await fs.utimes(file, new Date(), new Date());
|
11 | }
|
12 | }
|
13 | async function run(name, file) {
|
14 | await touch(file);
|
15 | const { body } = await http_call_1.default.get(`https://registry.npmjs.org/${name.replace('/', '%2f')}`, { timeout: 5000 });
|
16 | await fs.outputJSON(file, body['dist-tags']);
|
17 | process.exit(0);
|
18 | }
|
19 | run(process.argv[2], process.argv[3])
|
20 | .catch(require('@oclif/errors/handle'));
|