In this Javascript tutorial on NPM Package.JSON we look at the 'EXPORTS' keyword and how it helps us expose and also encapsulate the functionality contained within out NPM package.
So by default Node uses the MAIN keyword to acomplish this, but there are limitations to this keyword and that is where the EXPORTS keyword can help us out. With EXPORTS we can expose subpaths, encapsulate and also conditionally exprt based on the environment we are running under even.
We look at each of these possibilities with a simple Add function in a Calc app that is created locally and then imported into a consumer application MyApp.