sheinsight / n-read-pkg

Read package.json, compatible with many boundary scenarios.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ“¦ @shined/n-read-pkg

This is a module for reading the specified module's package.json information.

πŸ€” why

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.

πŸ”₯ Install

npm install @shined/n-read-pkg -D

🦾 Usage

Instructions for use

πŸ“š Api

api

πŸ«‚ Maintainers

About

Read package.json, compatible with many boundary scenarios.

License:MIT License


Languages

Language:TypeScript 67.3%Language:JavaScript 32.7%