
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Reco LAN control API
npm install node-reco
const Reco = require('node-reco');
/* 立刻打开电源 */
Reco.powerOn('192.168.29.66').then(() => {/.../});
/* 立刻关闭电源 */
Reco.powerOff('192.168.29.66').then(() => {/.../});
/* 延时1分钟后打开电源 */
Reco.powerOn('192.168.29.66', 1).then(() => {/.../});
/* 延时1分钟后关闭电源 */
Reco.powerOff('192.168.29.66', 1).then(() => {/.../});
/* 获取当前输出参数 */
Reco.info('192.168.29.66').then((info) => {console.log(info)});
//=> { I: 8, U: 23678, F: 4999, P: 74, PQ: 0, E: 22015, EQ: 0 }
/* 扫描192.168.29.xx网段内所有的Reco插座 */
Reco.discover("192.168.29.255").then((devs) => {console.log(devs)});
/*
=> [
{
ip: '192.168.29.66',
mac: 'ACCF23484D70',
sn: '040002298',
res: 1,
status: 1
}
]
*/
export interface RecoPowerInfo {
/** 电流值 0.01A */
I: number;
/** 电压值 0.01V */
U: number;
/** 频率值 0.01Hz */
F: number;
/** 有功功率值 0.1W */
P: number;
/** 无功功率值 0 */
PQ: number;
/** 有功能量值 1WH */
E: number;
/** 无功能量值 0 */
EQ: number;
}
export interface RecoDeviceInfo {
/** 插座IP地址 */
ip: string;
/** 插座MAC地址 */
mac: string;
/** 设备序列号 */
sn: string;
/** 插座与远程复位器的连接状态 */
res: number;
/** 插座的状态 "1": ON ,"0": OFF */
status: number;
}
/**
* 立即或延时打开电源
* @param ipaddr - 插座IP地址
* @param delay - 延时执行(单位分钟),默认为0,表示立即执行
* @param broad - 槽位号,默认为1
*/
export declare function powerOn(ipaddr?: string, delay?: number, broad?: number): Promise<string>;
/**
* 立即或延时关闭电源
* @param ipaddr - 插座IP地址
* @param delay - 延时执行(单位分钟),默认为0,表示立即执行
* @param broad - 槽位号,默认为1
*/
export declare function powerOff(ipaddr?: string, delay?: number, broad?: number): Promise<string>;
/**
* 获取指定插座的电源输出参数
* @param ipaddr - 插座IP地址
*/
export declare function info(ipaddr?: string): Promise<RecoPowerInfo>;
/**
* 扫描指定网段内的插座
* @param host - 插座IP地址或局域网广播地址
* @param timeout - 扫描超时时间,默认500ms
* @param max - 数组最大长度,默认65535个
*/
export declare function discover(host?: string, timeout?: number, max?: number): Promise<unknown>;
declare const _default: {
powerOn: typeof powerOn;
powerOff: typeof powerOff;
info: typeof info;
discover: typeof discover;
};
export default _default;
FAQs
Reco LAN control API
We found that node-reco demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.