Replace http/https with axios in CLI

This commit is contained in:
Simon Warta 2020-03-20 11:03:44 +01:00
parent ccb36aa90a
commit 2217c51a00
3 changed files with 4 additions and 5 deletions

View File

@ -42,6 +42,7 @@
"@iov/encoding": "^2.1.0",
"@iov/utils": "^2.0.2",
"argparse": "^1.0.10",
"axios": "^0.19.2",
"babylon": "^6.18.0",
"colors": "^1.3.3",
"diff": "^4",

View File

@ -111,8 +111,7 @@ export function main(originalArgs: readonly string[]): void {
console.info(colors.green("Initializing session for you. Have fun!"));
console.info(colors.yellow("Available imports:"));
console.info(colors.yellow(" * http"));
console.info(colors.yellow(" * https"));
console.info(colors.yellow(" * axios"));
console.info(colors.yellow(" * fs"));
for (const [moduleName, symbols] of imports.entries()) {
console.info(colors.yellow(` * from ${moduleName}: ${symbols.join(", ")}`));
@ -130,8 +129,7 @@ export function main(originalArgs: readonly string[]): void {
console.info(colors.yellow(` * helper functions: ${encodingHelpers.join(", ")}`));
let init = `
import * as http from 'http';
import * as https from 'https';
import axios from "axios";
import * as fs from "fs";
`;
for (const [moduleName, symbols] of imports.entries()) {

View File

@ -1747,7 +1747,7 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e"
integrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==
axios@^0.19.0:
axios@^0.19.0, axios@^0.19.2:
version "0.19.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27"
integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==