New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@deplens/core

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deplens/core

Core engine for inspecting installed package exports and types

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
52
940%
Maintainers
1
Weekly downloads
 
Created
Source

@deplens/core

Programmatic API for inspecting installed packages: runtime exports, parsed type signatures, and JSDoc.

Install

npm i @deplens/core

Usage

import { runInspect, runDiff } from '@deplens/core';

const output = await runInspect({
  target: 'ai',
  showTypes: true,
  filter: 'generate',
  resolveFrom: process.cwd(),
});

console.log(output);

const diff = await runDiff({
  package: 'express',
  from: '4.18.0',
  to: '4.19.0',
  format: 'json',
});

console.log(diff.output);

runInspect returns a string when no custom writers are provided. If you pass write or writeError, it will stream to those instead.

Options

  • target (string, required): package name or import path (e.g. react, next/server)
  • filter (string): substring filter for export names
  • showTypes (boolean): include type signatures from .d.ts
  • kind (string[]): filter by export kind (function, class, object, constant)
  • runtime (boolean): import the package entrypoint for runtime exports; set false for static type/package inspection
  • analyzeSource (boolean): include source complexity and implementation summaries
  • depth (number): object inspection depth (0–5)
  • resolveFrom (string): base directory for module resolution
  • cwd (string): working directory for the inspection
  • write (function): output sink (defaults to collecting and returning a string)
  • writeError (function): error output sink

JSDoc options:

  • jsdoc (string): off | compact | full
  • jsdocOutput (string): off | section | inline | only
  • jsdocQuery (object):
    • symbols: string or string[]
    • sections: summary | params | returns | tags
    • tags.include / tags.exclude: string[]
    • mode: compact | full
    • maxLen: number
    • truncate: none | sentence | word

Example: JSDoc focused on params/returns

await runInspect({
  target: 'ai',
  showTypes: true,
  jsdocOutput: 'section',
  jsdocQuery: {
    symbols: 'generateText',
    sections: ['params', 'returns'],
    tags: { include: ['param', 'returns'] },
    mode: 'compact',
    truncate: 'sentence',
    maxLen: 220,
  },
});

Notes

  • JSDoc is extracted from .d.ts declarations, not runtime JS.
  • Source analysis recognizes ESM exports, default exported functions, and common CommonJS assignment patterns.
  • --resolve-from is essential in monorepos to avoid false negatives.

License

MIT

FAQs

Package last updated on 10 Jul 2026

Related posts