npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

decoapiwrapper

v1.0.11

Published

Typescript Wrapper for consuming Deco routers as endpoints

Readme

DecoAPIWapper

DecoAPIWapper is a Node.js-based project designed for making it easy to get information out of tp-link deco routers. This project utilizes various cryptographic utilities and provides a robust testing suite to ensure functionality.

Table of Contents

Installation

To get started with DecoAPI, clone the repository and install the necessary dependencies:

git clone https://github.com/mathiastornblom/DecoAPIWaper.git
cd DecoAPIWaper
npm install

Available methods

  • [x] Performance: Get CPU and Memory usage
  • [x] ClientList: Get connected clients
  • [x] Custom: Make a custom request to the router
  • [x] DeviceList: Get connected Decos
  • [x] Reboot: Reboot Deco mesh node(s)

Usage

Provide a brief description of how to use the project. For example:

import DecoAPIWraper from 'decoapiwrapper';

const client = new DecoAPIWraper(process.env.DECO_IP || '');

//async authenticate(password: string): Promise<void>
await client.authenticate(decoPassword);
{
  "result": {
    "stok": "d9303c6a85a5206aaabaf2845fe87d24"
  },
  "error_code": 0
}

// async performance(): Promise<PerformanceResponse>
const performance = await client.performance();
console.log('Performance Data:', performance);
{
  "result": {
    "mem_usage": 0.52,
    "cpu_usage": 0.26
  },
  "error_code": 0
}

// async clientList(): Promise<ClientListResponse>
const clientList = await client.clientList();
console.log('Client List:', clientList);
{
  "result": {
    "client_list": [
      {
        "mac": "AA-AA-AA-AA-AA-AA",
        "up_speed": 34,
        "down_speed": 520,
        "wire_type": "wireless",
        "access_host": "1",
        "connection_type": "band2_4",
        "space_id": "1",
        "ip": "192.168.68.52",
        "client_mesh": true,
        "online": true,
        "name": "Name of the device",
        "enable_priority": false,
        "remain_time": 0,
        "owner_id": "",
        "client_type": "pc",
        "interface": "main"
      }
    ]
  },
  "error_code": 0
}

//async deviceList(): Promise<DeviceListResponse>
const deviceList = await client.deviceList();
console.log('Device List:', deviceList);
{
  "result": {
    "device_list": [
      {
        "nand_flash": true,
        "hardware_ver": "1.2",
        "bssid_sta_2g": "",
        "software_ver": "1.2.0 Build 20231229 Rel. 43148",
        "role": "master",
        "bssid_sta_5g": "",
        "inet_status": "online",
        "support_plc": false,
        "oversized_firmware": false,
        "bssid_5g": "FF:FF:FF:FF:FF:FF",
        "set_gateway_support": true,
        "inet_error_msg": "well",
        "group_status": "connected",
        "nickname": "My Deco X50",
        "bssid_2g": "FF:FF:FF:FF:FF:FF",
        "mac": "FF-FF-FF-FF-FF-FF",
        "oem_id": "83acf77142b8234265bc2f7776cf0e38",
        "signal_level": {
          "band5": "0",
          "band2_4": "0"
        },
        "product_level": 200,
        "device_ip": "192.168.68.1",
        "device_model": "X50",
        "hw_id": "8e35a385852db59e22303e0b96fd227c",
        "device_type": "HOMEWIFISYSTEM"
      }
    ]
  },
  "error_code": 0
}

// async reboot(...macAddrs: string[]): Promise<{ [key: string]: any }>
// async custom(path: string, params: EndpointArgs, body: Buffer) Promise<any>

Environment Variables

The project uses environment variables defined in the .env file. Make sure to configure them appropriately before running the project.

  • DECO_IP: IP of your router
  • DECO_PASSWORD: the password for your tp-link app

Testing

DecoAPI includes a suite of tests to ensure the integrity of the code. To run the tests, use the following command:

npm test

Project Structure

A brief overview of the project's structure:

DecoAPI/
├── src/              # Source files
│   ├── client.ts     # Client-related logic
│   ├── deco.ts       # Main entry point
│   └── utils/        # Utility functions (e.g., AES, RSA encryption)
├── tests/            # Test files
│   └── client.test.ts# Unit tests for client
├── .env              # Environment variables
├── .gitignore        # Git ignore rules
├── package.json      # Project dependencies and scripts
└── README.md         # Project documentation

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes. Make sure to follow the code style guidelines and include relevant tests.

License

This project is licensed under the MIT License - see the LICENSE file for details.