changed cli arguments - breaking change

This commit is contained in:
nightness 2021-11-11 15:48:48 -06:00
parent 17f69f80e8
commit 3e769771f9
2 changed files with 5 additions and 3 deletions

View File

@ -1,3 +1,5 @@
# ngrok-to-dotenv
This is a ngrok start-up wrapper that uses a dotenv file (at '../.env' relative to this project's folder) to get the authtoken and save the https address; it's a node cli tool that you can use with projects that need ngrok. You clone it into your project's folder, and add to the project's package.json a run script to call "cd ngrok-to-dotenv && node ngrok". Be sure to add the folder to your .gitignore and install the one package which is ngrok and command-line-args, using 'npm i' or 'yarn'. The 'node ngrok' script supports two arguments --proto or -p (string, example 'html'), --addr or -a (number, the port number).
This is a ngrok start-up wrapper that uses a dotenv file (at '../.env' relative to this project's folder) to get the authtoken and save the https address; it's a node cli tool that you can use with projects that need ngrok. You clone it into your project's folder, and add to the project's package.json a run script to call "cd ngrok-to-dotenv && node ngrok". Be sure to add the folder to your .gitignore and install the one package which is ngrok and command-line-args, using 'npm i' or 'yarn'. The 'node ngrok' script supports two arguments --proto or -P (string, the protocol), --port or -p (number, the port number).
By default 'node ngrok' (no arguments) is equivalent to 'node ngrok -P http -p 3000' and 'node ngrok --proto http --port 3000'.

View File

@ -5,8 +5,8 @@ const { exec } = require("child_process");
const dotenvFile = "../.env";
const optionDefinitions = [
{ name: "proto", alias: 'p', type: String },
{ name: "addr", alias: 'a', type: Number },
{ name: "proto", alias: 'P', type: String },
{ name: "port", alias: 'p', type: Number },
];
const commandLineArgs = require("command-line-args");