esm-cjs-risk-scan

Scan Node/Electron projects for npm dependencies with ESM/CJS runtime loading risks.

44.4k|2.8k|Updated May 23, 2020
One-click install
npx skills add https://github.com/logseq/logseq --skill esm-cjs-risk-scan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: esm-cjs-risk-scan
Source: https://github.com/logseq/logseq/tree/main/.agents/skills/esm-cjs-risk-scan
Command: npx skills add https://github.com/logseq/logseq --skill esm-cjs-risk-scan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill detects npm packages loaded via Node/Electron code that may fail at runtime due to ESM/CJS incompatibility issues.

Core Features & Use Cases

  • Risk Analysis: Scans project files for npm dependencies loaded with require() or import(), highlighting potential runtime failures.
  • Scope Flexibility: Can evaluate specific Electron or all Node-related source directories.
  • Use Case: Before upgrading Electron dependencies, audit code to identify packages prone to load failure or requiring special handling.

Quick Start

Use the esm-cjs-risk-scan skill to analyze your Electron project by scanning the main source directory and outputting a detailed report on dependency risks.

Frequently Asked Questions about esm-cjs-risk-scan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify npm dependencies that fail at runtime due to ESM/CJS incompatibility in Electron?

Identifying npm dependencies that fail at runtime due to ESM/CJS incompatibility in Electron requires scanning project code for import patterns and probing package.json for module types to highlight potential loading failures. This Skill automates that dependency risk auditing process.

What is the best way to audit Node dependency risks before upgrading an Electron environment?

The best way to audit Node dependency risks before upgrading an Electron environment is to evaluate project source directories for npm packages loaded via require() or import(). This process detects packages prone to load failure due to module type mismatches.

Does this dependency risk scanner evaluate specific Electron source directories or all Node-related files?

Yes, the dependency risk scanner offers scope flexibility to evaluate either specific Electron source directories or all Node-related project files. It examines code for import patterns to ensure comprehensive dependency management and runtime stability.

Can I use this tool to check package.json for module types and exports during dependency management?

Yes, you can use this tool to check package.json for module types and exports during dependency management. It probes package.json configurations alongside scanning project files for import patterns to identify ESM/CJS mismatches that may cause runtime loading issues.

Why do my Node packages encounter runtime loading issues after an Electron dependency upgrade?

Node packages encounter runtime loading issues after an Electron dependency upgrade due to ESM/CJS mismatches. When project code uses require() or import() on incompatible npm packages, the module loading fails at runtime, requiring automated risk analysis to identify and resolve these conflicts.