140 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
60
views
Epilogue for `yargs` Commands
I'm writing a command-line application in TypeScript using yargs. I want to add an epilogue to the auto-generated help. That works fine for the overall usage information but not for (sub)commands. ...
1
vote
0
answers
57
views
Running 1 command with yargs, for some reason it runs all
When I run 1 cli command (contenthook run ) example script: start. Then it doesn't execute any command and in my older version of the code without passing the handler to yargs, it executed all ...
0
votes
1
answer
186
views
How to pass arguments to Yargs commands at esm 'mode'?
I wrote a simple Node.js application that uses yargs commands and is built using CommonJS. It works as expected.
Now I'm trying to rewrite it to ESM.
The detailed code is provided at the end if needed....
0
votes
1
answer
235
views
Cannot use puppeteer because it fails loading yargs/yargs dependency
I'm trying to run a chromium browser on my AWS Lambda (node.js). This is the code I'm using
import chromium from 'chrome-aws-lambda';
...
const browser = await chromium.puppeteer.launch({
args:...
0
votes
0
answers
432
views
Getting yargs_1.default.options is not a function while using the yargs
I am trying to use yargs library in my nestjs framework application, where few parameters i will be taking from command line args, if these parameters are not provided, I will be using the default one....
-2
votes
1
answer
329
views
"yargs" won't trigger any command of a script
I have a NodeJs script in which I need parse command line arguments.
I've written this code:
import yargs from "yargs";
import { hideBin } from 'yargs/helpers';
//....
yargs(hideBin(...
3
votes
1
answer
1k
views
Property does not exist using yargs and typescript
I am trying to parse a command line with yargs in typescript and it doesn't work:
import yargs from 'yargs';
const argv = yargs
.option('label', {
alias: 'l',
describe: 'Execute bot with ...
0
votes
1
answer
568
views
How do i extract arguments using yargs?
I'm using yargs lib in project. Importing it like this:
import { argv } from 'yargs';
Accessing all of args as following:
console.log('!!! start work', argv);
which gives the output smth like this:
!...
3
votes
1
answer
693
views
How to create yargs default response when no command selected
I have created a CLI with yargs. It has a series of nested commands. All the commands work nicely, but I also want to have a welcome/info message when no command is given or if a command that does not ...
2
votes
0
answers
246
views
Yargs help not display properly while --h is working
In my CLI when I call node cli.js --help I get this:
Options:
--help Show help [boolean]
--version Show version number ...
0
votes
1
answer
186
views
Error when integrating Wetty with a ReactJS project
I am trying to integrate Wetty API with a simple ReactJS project. I first ran into the shebang error.
ERROR in ./node_modules/wetty/build/main.js 1:0
Module parse failed: Unexpected character '#' (1:0)...
0
votes
1
answer
755
views
How do I pass parameters to an NPM script that uses nodenv?
I have a NodeJS app that uses the NPM package node-env-run (i.e. to load environment variables from .env file). The package.json, I have a script that looks like this:
"scripts": {
&...
2
votes
1
answer
1k
views
How to define / get types of argv in command handler with yargs?
I am trying to create a CLI utility with Yargs but the types of argv in my command handlers are unknown. I installed @types/yargs as well but still cannot resolve the types. Any help would be greatly ...
0
votes
1
answer
143
views
What is the typed output of the Yarg() function?
I've been making a CLI and i needed yargs for parsing my arguments in a nice way. I am using typescript and i don't know the output of this Function, didn't find it anywhere as well:
const argv = ...
0
votes
1
answer
57
views
yargs argument not binding correctly in linux
I am trying to run a node application which uses yargs to read arguments.
Following is the code for that.
export class RunCommand {
public async run(): Promise<string> {
let ...
S7H's user avatar
- 1,655