Socket
Book a DemoInstallSign in
Socket

ebpf-support

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ebpf-support

A Node.js package to check if the system supports eBPF and return related metadata

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

ebpf-support

A Node.js package to check if the system supports eBPF and return related metadata.

Installation

npm install ebpf-support

Usage

const { isEbpfSupported, checkEbpfSupport } = require('ebpf-support');

// Simple check
if (isEbpfSupported()) {
  console.log('eBPF is supported on this system');
} else {
  console.log('eBPF is not supported on this system');
}

// Get detailed metadata
const metadata = checkEbpfSupport();
console.log(metadata);

Metadata

The checkEbpfSupport() function returns an object with the following properties:

PropertyTypeDescription
supportedbooleanWhether eBPF is supported on the system
kernelVersionstringThe kernel version of the system
bpfConfigEnabledbooleanWhether BPF is enabled in the kernel config
bpfSyscallEnabledbooleanWhether BPF syscall is enabled
bpfJitEnabledbooleanWhether BPF JIT compiler is enabled
bpfJitAlwaysOnbooleanWhether BPF JIT is always on
bpfFilesystemMountedbooleanWhether BPF filesystem is mounted
bpfToolAvailablebooleanWhether bpftool is available on the system
bpfFeaturesobjectDetailed BPF features from bpftool (if available)
configFlagsobjectBPF-related kernel config flags
reasonstringReason why eBPF is not supported (if applicable)

Requirements

  • Node.js 16.0.0 or later
  • Linux operating system (eBPF is only supported on Linux)

Testing

Run the tests using Node.js's built-in test runner:

npm test

License

MIT

Keywords

ebpf

FAQs

Package last updated on 09 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts