This is a module for reading the specified module's package.json information.
When we read packages of modules in our daily life, we always encounter some boundary scenarios.
For example:
- target module is not configured 'package.json' into 'exports' field
- target module is typescript type utils module , so it has no 'main' 'module' and 'exports' field
- target is built-in module
- has multiple package.json in the module see terser
.
βββ CHANGELOG.md
βββ LICENSE
βββ PATRONS.md
βββ README.md
βββ bin
βββ dist
β βββ bundle.min.js
β βββ package.json // <--- this is wrong package.json
βββ lib
βββ main.js
βββ node_modules
βββ package.json // <--- this is correct package.json
βββ tools
π We try to solve these problems in this module.
npm install @shined/n-read-pkg -D
Instructions for use
api