Packages like create-next-app automatically run a node script when you use that package (maybe just through npx idk). I’m trying to replicate this but am having trouble. I tried to add a bin object with my package name pointing to the file to run, but this just opens the file in an editor, doesn’t run it. See https://github.com/vercel/next.js/blob/5c9aba418dc8c2d907508c024387004fbaac181d/packages/create-next-app
I’d like the user flow to be
npm i <mypackage>
OR
npx <mypackage>
if npm i
not possible
and have the script automatically run.