New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

padavan

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

padavan

The core library for interacting with routers running Padavan firmware. Provides a programmatic API for local control via HTTP.

latest
Source
npmnpm
Version
2.2.0
Version published
Maintainers
1
Created
Source

padavan

[RU] | [EN]

A Node.js library for managing routers running Padavan firmware.

It interacts with the router via its Web Interface (HTTP), providing programmatic access to configuration, diagnostics, and firmware management functions.

Migration

Upgrading from v1? Check the Migration Guide for details on breaking changes (move from SSH to HTTP, new constructor) and removed features.

Installation

npm install padavan

Usage

import Padavan from 'padavan';

const client = new Padavan({
    credentials: {
        host: '192.168.1.1',
        username: 'admin',
        password: 'password'
    },
    logLevel: 'error'
});

// Get system status
const status = await client.getStatus();
console.log(`Uptime: ${status.uptime}`);

Configuration

The constructor accepts a config object with the following properties:

PropertyDescription
credentialsObject containing connection details.
logLevelLogging level: 'none', 'error', 'info', 'debug'.

Credentials Object

PropertyDescription
hostRouter IP address or hostname.
usernameWeb interface username.
passwordWeb interface password.
repoGitHub owner/repo for firmware updates.
branchGitHub branch (e.g., main).
tokenGitHub PAT for accessing Actions/Artifacts.

API

System & Diagnostics

  • getStatus() Returns CPU load, RAM usage, uptime, and basic Wi-Fi status.
  • getLog() Fetches the complete system log.
  • exec(command) Executes a system command via the web console emulator (SystemCmd). Returns: Command output (stdout + stderr).
  • sendAction(action, payload?) Sends a low-level action to apply.cgi. Arguments: action (string, e.g., ' Reboot '), payload (data object). Returns: Server response (command output or status).
  • startReboot() Reboots the router via HTTP command.

Network & Clients

  • getDevices() Returns a list of connected clients from the ARP table and Wi-Fi driver. Properties: mac, ip, hostname, type (eth, wifi, 2.4GHz, 5GHz), rssi.
  • getHistory() Returns traffic statistics. Structure: { daily: [...], monthly: [...] }.

Wi-Fi Tools

  • startScan(band) Performs a Site Survey (scan). Band: '2.4' or '5'.
  • getBestChannel(band) Wi-Fi Doctor: Scans the environment, calculates interference scores, and recommends the optimal channel for your router.

NVRAM & Settings

  • getParams(keys?, page?) Returns NVRAM variables. Arguments:
    • keys: Specific key string or array of keys. If omitted, returns all.
    • page: If provided, parses input fields from a specific ASP page HTML instead of using nvram show.
  • setParams(params, options?) Sets NVRAM variables. Options: action_mode (e.g., ' Apply '), sid_list (Service IDs to restart), group_id, current_page.

Firmware Management

Requires GitHub credentials (repo, branch, token).

  • findFirmware(model?) Searches for firmware artifacts in the configured repository network (looks into forks).
  • getChangelog() Compares the current router version with the latest artifact and returns a list of commits.
  • startBuild() Triggers a GitHub Actions workflow to build new firmware.
  • startUpgrade() Downloads the latest artifact, uploads it to the router, and flashes it.

CLI

This package includes a CLI tool. See CLI Documentation.

Keywords

router

FAQs

Package last updated on 24 Jan 2026

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