New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@devlens/core

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devlens/core

Automatic runtime error detection and logging for JavaScript applications

Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
13
-13.33%
Maintainers
1
Weekly downloads
 
Created
Source

@devlens/core

Automatic runtime error detection for JavaScript applications. Detects API failures, null/undefined access, missing render data, and unhandled errors -- with actionable context.

Installation

npm install @devlens/core

Quick Start

import {
  createDetectionEngine,
  createNetworkInterceptor,
  createGlobalCatcher,
  createDataGuardian,
} from '@devlens/core';

const engine = createDetectionEngine();

const network = createNetworkInterceptor(engine);
network.install();

const catcher = createGlobalCatcher(engine);
catcher.install();

const guardian = createDataGuardian(engine);
const data = guardian.guard(apiResponse, 'apiResponse');

// Accessing null/undefined properties now auto-logs
console.log(data.user.profile.avatar);

Console Output

[NET] DevLens [ERROR] network: POST /api/users returned 500 Internal Server Error
  |- Status: 500
  |- Duration: 1234ms
  |- Suggestion: Server returned 500 -- check server logs
  \- Source: NetworkInterceptor

API Reference

ExportDescription
createDetectionEngine(config?)Creates the core detection engine
createNetworkInterceptor(engine, config?)Fetch/XHR interceptor
createDataGuardian(engine, config?)Proxy-based null/undefined detection
createGlobalCatcher(engine, config?)Global error + unhandled rejection handler
createConsoleReporter()Formatted console output

Features

  • Zero dependencies
  • ~20KB ESM bundle
  • Dual ESM + CJS output
  • Full TypeScript declarations
  • Production-safe -- auto-disabled when NODE_ENV === 'production'
  • Tree-shakeable (sideEffects: false)

License

MIT -- github.com/crashsense/devlens

Keywords

devlens

FAQs

Package last updated on 24 Feb 2026

Related posts