NextJS CLI script

How do I go about running a script as a "CLI" script in my NextJS project? I've tried https://dev.to/philippe/create-a-cli-script-in-your-nextjs-project-2pg2 but it looks like I can't "import" using that (module does not export...)
DEV Community
Create a CLI script in your NextJS project
You put everything you need in your NextJS project: pages, code, tests, stories... Some of these...
Solution:
Create a .ts file anywhere in your src dir and use https://github.com/egoist/tsno to run it
GitHub
GitHub - egoist/tsno: node with typescript support, importing fro...
node with typescript support, importing from URL, etc. - GitHub - egoist/tsno: node with typescript support, importing from URL, etc.
Jump to solution
1 Reply
Solution
Vincent Udén
Vincent Udén11mo ago
Create a .ts file anywhere in your src dir and use https://github.com/egoist/tsno to run it
GitHub
GitHub - egoist/tsno: node with typescript support, importing fro...
node with typescript support, importing from URL, etc. - GitHub - egoist/tsno: node with typescript support, importing from URL, etc.