How do you find what scripts are defined in a project and can be executed using npm?
Experience Level: Senior
Tags: npm
Answer
There are two ways how you can find scripts that are defined in package.json and that can be executed.
Option 1
Open your command line and run the following command:
npm run
Option 2
Open a file package.json and find the property scripts. Each property of the object that as assigned to property scripts is a script that can be executed.
Related npm job interview questions
How do you add a new devDependency to a file package.json?
npm JuniorWhat are scripts in a file package.json used for and how can they be helpful?
npm SeniorHow do you import a npm scoped package to your module?
npm SeniorUsing npm, how do you publish a package so it becomes available only to people in your organization?
npm SeniorWhat are npm scoped packages and what are they good for?
npm Senior