Detalhes do pacote

pkgscan

nguyenngoclongdev8.7kMIT1.0.25

Retrieve information on installed packages across npm, pnpm and yarn

find, search, scan, installed

readme (leia-me)

CI GitHub license

npm version Gitpod Ready-to-Code install size npm bundle size npm downloads

pkgscan

npm yarn pnpm

pkgscan is a useful tool to inspect installed packages in your project. It provides detailed information about installed packages managed by popular package managers like npm, pnpm and yarn.

pkgscan

If you find this package useful for your projects, please consider supporting me by Patreon, KO-FI or Paypal. It's a great way to help me maintain and improve this tool in the future. Your support is truly appreciated!

KO-FI Paypal Patreon

Installation

npm

# Try with npx
npx pkgscan [options]

# Locally in your project.
npm install pkgscan

# Or globally (use as cli)
npm install -g pkgscan

CLI

Usage

pkgscan [options]

Options:
  -p, --pkg    The name of the package to retrieve information for.
  -c, --cwd    The current working directory of the project.
  -h, --help   Show help

Examples

# Get details about the installed package with automatic package manager detection.
pkgscan --pkg typescript

# Get details about the installed package with glob pattern.
pkgscan --pkg '@types/*'

# To scan all installed packages
pkgscan --pkg '*'

# Get details about the installed package with a user-specified package manager.
pkgscan --pkg typescript --cwd ./project-directory-path

API

import { getInstalledPackage } from 'pkgscan';

// Get details about the installed package with automatic package manager detection.
const installedPackage = getInstalledPackage('typescript');
console.log(installedPackage);
/*
[
  {
    name: 'typescript',
    version: '5.1.3',
    isDirectProjectDependency: true,
    dev: true,
    license: 'Apache-2.0',
    engines: { node: '>=14.17' }
  }
]
*/

// Get details about the installed package with a user-specified package manager.
const cwd = __dirname;
const installedPackage = getInstalledPackage('typescript', cwd);
console.log(installedPackage);
/*
[
  {
    name: 'typescript',
    version: '5.1.3',
    isDirectProjectDependency: true,
    dev: true,
    license: 'Apache-2.0',
    engines: { node: '>=14.17' }
  }
]
*/

isDirectProjectDependency used to determine whether a package is a direct dependency of a project or not. By using this variable, you can check whether a package is directly listed in the dependencies section of the project's package.json file or not.

Feedback

If you discover a bug, or have a suggestion for a feature request, please submit an issue.

LICENSE

This extension is licensed under the MIT License

changelog (log de mudanças)

@vscode-utility/fs-browserify

1.0.25

Patch Changes

  • 7c43264: fix: detect the package manager

1.0.24

Patch Changes

  • b80cfb2: remove strip-bom package

1.0.23

Patch Changes

  • c88ded1: using strip-bom for cjs

1.0.22

Patch Changes

  • 53234b7: support esm and cjs

1.0.21

Patch Changes

  • 9f77912: use tsup to ship ESM & CJS

1.0.20

Patch Changes

  • 4416f71: support es-module
  • 2cd6761: generate types

1.0.19

Patch Changes

  • aa165dd: add LICENSE for using a part source code from pnpm

1.0.18

Patch Changes

  • 5ecd06d: update README

1.0.17

Patch Changes

  • e84b7cf: update README

1.0.16

Patch Changes

  • 68f0d3d: set undefined if not find property

1.0.15

Patch Changes

  • a5ad038: remove show help on fail

1.0.14

Patch Changes

  • 8cc9cef: show help on fail

1.0.13

Patch Changes

  • 0e73f37: show cli version and short version cli

1.0.12

Patch Changes

  • d349611: show cli version

1.0.11

Patch Changes

  • de29efd: add resolution to detect installed package

1.0.10

Patch Changes

  • b0402aa: normalize package version on pnpm

1.0.9

Patch Changes

  • 6bd3c5c: normalize package version on pnpm

1.0.8

Patch Changes

  • f7b8020: not detect direct project dependency on pnpm

1.0.7

Patch Changes

  • 8075f5d: parse pnpm lock file

1.0.6

Patch Changes

  • e3415c4: remove promise

1.0.5

Patch Changes

  • a3e10b7: improve the performance when scan package

1.0.4

Patch Changes

  • 00d7dca: support searching installed package with glob pattern

1.0.3

Patch Changes

  • 2a096f8: support check direct install in project with npm and yarn

1.0.2

Patch Changes

  • 5fe6772: remove images folder to decrease package size

1.0.1

Patch Changes

  • db0da5d: Release stable version and public source code

0.0.1

Patch Changes

  • 85eb4ee: publish beta

1.0.4

Patch Changes

  • dbfa7b9: remove only-allow script

1.0.3

Patch Changes

  • ae1dce2: support fs.watch() and fs.access()

1.0.2

Patch Changes

  • 74286f4: update the content of README file

1.0.1

Patch Changes

  • 1be610d: first publish