
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
@edgeone/ef-cls-sdk
Advanced tools
基于 tencentcloud-cls-sdk-js 进行开发,适配 EdgeFunctions Runtime API,用于在 EdgeOne 边缘函数中进行 CLS 日志上报。
npm i @edgeone/ef-cls-sdk
import { AsyncClient, Content, LogGroup, LogItem, PutLogsRequest } from '@edgeone/ef-cls-sdk';
/** CONFIG START */
const TENCENT_SECRET_ID = 'xxxxx';
const TENCENT_SECRET_KEY = 'xxxxx';
const CLS_END_POINT = 'ap-xxxxx.cls.tencentcs.com';
const CLS_TOPIC_ID = 'xxxxx';
/** CONFIG END */
const clsAsyncClient = new AsyncClient({
endpoint: CLS_END_POINT,
secretId: TENCENT_SECRET_ID,
secretKey: TENCENT_SECRET_KEY,
sourceIp: 'edge',
retry_times: 1,
});
async function clsUpload(data: string) {
const logGroup = new LogGroup();
const logItem = new LogItem();
const logTime = Math.floor(Date.now() / 1000);
const logContent = new Content('__CONTENT__', JSON.stringify(data));
logItem.setTime(logTime);
logItem.pushBack(logContent);
logGroup.addLogs(logItem);
const clsRequest = new PutLogsRequest(CLS_TOPIC_ID, logGroup);
return await clsAsyncClient.PutLogs(clsRequest);
}
async function doClsUpload(request: Request) {
try {
const data = await request.clone().text();
await clsUpload(data);
} catch (err) {
console.error(`cls upload error: ${err}`);
}
}
async function handleRequest(event: FetchEvent) {
const { request } = event;
const contentType = request.headers.get('content-type') || '';
if (contentType.includes('application/json') || contentType.includes('text/plain')) {
// 用于通知边缘函数等待 Promise 完成,可延长事件处理的生命周期,不阻塞 fetch(request) 的返回。
event.waitUntil(doClsUpload(request));
}
return;
}
addEventListener('fetch', handleRequest);
FAQs
Edgefunctions CLS SDK
The npm package @edgeone/ef-cls-sdk receives a total of 9 weekly downloads. As such, @edgeone/ef-cls-sdk popularity was classified as not popular.
We found that @edgeone/ef-cls-sdk 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.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.