I think the above answers are good, but if you just need a little bit of data from the user they seem like overkill. For simple user input you might try the following and avoid additional files or third party libraries.
{
"step1": "#!/usr/bin/env bash \n read -p \"What is your name? \" name \n npm run step2 $name",
"step2": "echo Hello, $1",
}
Here is an example of how you might use it to start a http server on a user specified port:
{
"http1": "#!/usr/bin/env bash \n read -p \"What port do you want to use? \" port \n npm run http2 $port",
"http2": "http-server . -p $1",
}
For a slightly more complex example you might use npm-run-all. For example this will have the user type a specific string before continuing.
{
"reset": "run-s --print-label reset:*",
"reset:confirm": "#!/usr/bin/env bash \n set -e \n read -p \"Are you sure you want to reset everything? Type YES to continue : \" confirm \n if \n [ \"$confirm\" != \"YES\" ] ; then \n exit 1 \n fi",
"reset:db": "..."
}
package.jsonfile?