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

tencentcloud-tef-cli

v1.0.1-beta.2

Published

Command-line interface for TencentCloud EdgeFunctions

Downloads

22

Readme

tencentcloud-tef-cli

概述

  • 腾讯云边缘函数(EdgeFunctions)提供了 EdgeOne 边缘节点的 Serverless 代码执行环境,您只需编写业务函数代码并设置触发规则,无需配置和管理服务器等基础设施,即可在靠近用户的边缘节点上弹性、安全地运行代码。
  • EdgeFunctions CLI 是一个命令行工具,用于在本地创建工程化项目,调试、构建并将边缘函数部署至 EdgeOne 边缘节点。

快速开始

安装

您可以使用 npm 在全局安装 CLI 工具:

npm install -g tencentcloud-tef-cli

本地开发

如果您是在本仓库中进行本地开发,建议按以下流程执行:

# 在根目录执行
yarn install
yarn workspace tencentcloud-tef-cli run build

# 然后进入 tef-cli 子包目录执行
cd packages/tef-cli
npm link

执行后建议检查命令路径:

which -a tef
realpath "$(which tef)"

tef 应指向当前仓库路径(例如:.../ef-cli/packages/tef-cli/tef-bin/tef.js)。

如果 tef 仍指向 /usr/local/bin/tef,且当前 npm 全局前缀在 ~/.nvm/... 下,通常是旧的全局命令残留。可执行:

sudo rm -f /usr/local/bin/tef
sudo rm -rf /usr/local/lib/node_modules/tencentcloud-tef-cli

# 在 tef-cli 子包目录执行
npm link
hash -r

创建 edge function 应用

执行 tef create 命令,以分阶段流程创建一个新的 edge function 应用:

tef create

流程会先询问要将 edge function 应用创建到哪个目录,再引导您完成 template、language 以及其余初始化交互。

在当前 P0 步骤中,本地流程暂时只提供一个 template(Hello World),并支持 JavaScript 与 TypeScript 两种语言选项,同时保留了分阶段创建协议以便后续扩展。

如果您已经确定目标目录,也可以直接传入:

tef create my-edgefunction-app

tef init 仍保留为兼容命令,但默认推荐入口已经切换为 tef create

根据 tef create 过程中的交互选择,初始化后的应用通常会包含如下文件:

my-edgefunction-app
├── src
│   └── index.js(ts)   // 默认生成的 edge function 入口文件
├── .env               // 运行环境相关配置
├── tef.toml           // 打包构建、调试和部署相关的配置文件
├── tsconfig.json      // 可选:启用 TypeScript 时生成
└── package.json       // 可选:启用 package.json 创建时生成

配置

完整配置说明(tef.toml / .env)请参阅 docs/config-reference.zh-CN.md

项目初始化后,默认在根目录下生成 .env 文件,以下配置可根据实际情形自行定义:

# 腾讯云秘钥信息,用于鉴权(必填)
TENCENT_SECRET_ID=YOUR_SECRET_ID
# 腾讯云秘钥信息,用于鉴权(必填)
TENCENT_SECRET_KEY=YOUR_SECRET_KEY

项目初始化后,默认在根目录下生成 tef.toml 配置文件,以下配置可根据实际情形自行定义:

# EdgeFunction 名称,默认填写为您执行 init 命令时的项目名(必填)
name = "FUNCTION_NAME"
# EdgeFunction 打包构建时的入口文件,默认填写为 src/index.js(ts)(必填)。
main = "src/index.js(ts)"
# 站点ID,EdgeFunction 的部署运行与您的站点相关(必填)
zone_id = "YOUR_ZONE_ID"
# 项目初始化时间
create_date = "FUNCTION_INIT_DATE"

调试

您可以在项目根目录下运行 tef dev 命令,启动开发调试服务:

tef dev

服务启动后,您可以在浏览器中访问 http://localhost:8080 调试 EdgeFunction。

发布

您可运行 tef publish 命令将 EdgeFunction 部署至边缘节点:

tef publish

发布完成后,您可登录 EdgeOne 控制台查看已发布的函数。

联系方式

如果在使用过程中遇到问题,请随时通过 [email protected] 与我联系。

文档