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

tplink-escp

v0.2.0

Published

TypeScript implementation of TP-Link Easy Smart Configuration Protocol

Readme

tplink-escp

TypeScript library for the TP-Link Easy Smart Configuration Protocol (ESCP). Cross-platform Node.js replacement for the Windows-only Java Easy Smart Configuration Utility.

Supports TL-SG105E / SG108E / SG116E / SG1016DE / SG1024DE / SG108PE and similar.

Live-tested on a TL-SG1024DE hardware v7.0 running firmware 1.0.0 Build 20230616 Rel.34205.

Install

npm install tplink-escp

Discover switches

import { discoverSwitches } from 'tplink-escp';

const switches = await discoverSwitches({ timeout: 2000 });
for (const s of switches) {
  console.log(s.info.hostname, s.info.mac, s.info.ipAddress);
}

Read and modify config

import { SwitchClient } from 'tplink-escp';

const client = new SwitchClient({
  switchMac: '00:11:22:33:44:55',
  username: 'admin',
  password: 'adminpass',
});

await client.login();
const info = await client.getInfo();
const ports = await client.getPorts();
const vlans = await client.getVlans();
const pvids = await client.getPvids();
const bandwidth = await client.getBandwidthControl();
const storm = await client.getStormControl();

// VLANs must be set one-at-a-time (firmware bug).
await client.setVlan({
  vlanId: 10,
  name: 'office',
  memberPorts: [1, 2, 3],
  taggedPorts: [1],
  untaggedPorts: [2, 3],
});

await client.save();
client.close();

Supported operations

  • Discovery and login
  • System info, hostname, LED status, DHCP/static IP config, credential changes
  • Port config and port statistics
  • 802.1Q VLANs, PVIDs, management VLAN, MTU VLAN, and port-based VLAN mode
  • IGMP snooping and report suppression
  • QoS mode and per-port priority
  • Ingress/egress bandwidth control
  • Storm control
  • Port mirroring
  • Loop prevention
  • Cable test
  • PoE system/port/extend/recovery helpers for PoE-capable models
  • Save, reboot, and factory reset actions

Notes

  • UDP broadcast on ports 29808/29809. May require elevated permissions on some OSes.
  • Encryption: RC4-variant with a hardcoded key shipped in every firmware - this is not security.
  • Set VLANs one at a time to avoid corrupted VLAN names.
  • Always leave every port in at least one VLAN.
  • The client matches replies by sequence ID to avoid stale UDP responses being parsed as later requests.
  • Storm-control TLVs are 9 bytes on TL-SG1024DE v7.0: port, enabled flag, three traffic-type flags, and a 4-byte rate.
  • PoE helpers return empty data or throw an unsupported error on non-PoE switches.

Build

npm install
npm run build
npm test