I am making an NPM package, and I wonder how you can register multiple entry points so that the user can select either the entire library or only the part that they intend to use.
For example, to enter the entire library:
const mainLib = require('main-lib');
Or just part of it:
const subLib1 = require('sub-lib-1');
const subLib2 = require('sub-lib-2');
It seemed to me intuitive to have the main property of package.json accept multiple values, but this does not look like documentation.
source
share