Jay is a member of the NestJS core team, primarily helping out the community on Discord and Github and contributing to various parts of the framewo...
For further actions, you may consider blocking this person and/or reporting abuse
Also, by copying the example from this article, I would get:
Property 'personName' does not exist on type '{ name: string; age: number; }'.ts(2339)
I had to tweak the commend to look like this (also adding --name to option) before it would work:
paste.laravel.io/b566d7db-4791-48c...
Thanks for reporting that. The post has been updated to have the proper values
Nice, Great work!
Fantastic and interesting post! Great!
This is cool stuff. I'm going to be using it extensively in the next couple of weeks.
Scott
I was waiting for something like this. Awesome. Thanks!
Ps. You have a few typos in your code examples.
Thanks for saying something! This is what I get for writing everything in the online editor and not in my IDE
this is copy and pasta, how to use this nest-commander in real project. You just copied this not working example and even dont think about that main.ts can be already used for API backend purpose and your example is very silly.
Very nice article! Will give it a try
Love it Jay, great write up! 👏👏
(Btw tiny typo about in one code block you have @Opiton )
Thanks Mark! Got it fixed
I was looking at making my own solution, now I don't have to. Great, thanks!
Would be nice to show how to actually run the command - it took a bit of tinkering to figure out
I added a quick note of how you can run the command after the setup of the
src/main.ts
file. There's more information as well on the docs siteSorry for the stupid quest of mine.
I walk through this post, but I have no idea how to invoke that.
(I'm using translator), can I create an app integrating both standard NestJS and Commander, like I want to make a custom launch command for my nestjs web app, can I do that with both?
Yes, but depending on how you write your imports you might end up making a circular file chain so be careful about that. You'd essentially make the
run
or the command callNestFactory.create()
and the subsequent methodsThanks, this is so helpful <3