Image for post
Image for post
npm vs npx

Introduction

Source Code

Background

What are we going to do

Image for post
Image for post
npm vs npx

Coding with mocha-example-npm application

1. Install mocha globally, so that the command will be recognized globally

2. Use the path to mocha from node_modules

3. Configure test in your package.json file as follows.

Coding with mocha-example-npx application

What is npx

What if mocha is installed globally or locally and we run the command npx mocha?

Conclusion

Your turn. What do you think?

An engineer by profession and writer by passion. Microsoft MVP, Author, Blogger. sibeeshpassion.com, youtube.com/sibeeshPassion, youtube.com/njanorumalayali

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store