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

@zhangxg/nk

v1.0.0

Published

node serve

Downloads

3

Readme

nk

nk nodejs keep

功能清单

  • [ ] http 服务器
  • [ ] 应用代理
  • [ ] 静态资源服务器
  • [ ] 路由权限控制,静态文件权限控制
  • [ ] 邮件服务
  • [ ] 自动执行任务
  • [x] rtmp 服务器
  • [x] rtsp 服务器
  • [x] tcp 服务器
  • [x] udp 服务器

使用方法

demo 运用地址:https://github.com/zhangxinggang/LocalMusicPlayer.git

  1. git clone https://github.com/zhangxinggang/NK.git
  2. 新起项目,新建一个文件内容如下(例如为 index.js),路径根据实际情况而定
const services = require("@zhangxg/nk");
const config = require("./config");
services(config);
  1. npm install
  2. node index.js

config 文件内容

详细见 NK 目录下的 config.js

services
    --rtmpServer
    --rtspServer
    --tcpServer
    --udpServer
    --httpServer
        --protocols 协议
        --security 安全
            secret jwt加密的密钥
            tokenExpiresIn jwt过期时间
            noAuthorityRoutes 访问白名单,通配符
        --routes 路由
            dynamicRouteDirs 动态路由
            mountRouteDirs 挂载路由
            staticDirs 静态路由
            路由都为一个数组,数组的每一项有三个字段rootDir 必须 路由包含目录,rootPath 命名空间,默认/,auth 是否需要权限,默认true
        --proxy 路由代理
        --autoRunTask 自动运行服务
        --storage 存储服务
        --logger 日志设置
        --communication 邮件服务
        --project 你项目所需的字段,自定义

demo 路由地址(在 config 未配置的情况下)

静态路由带权限:http://127.0.0.1:8081/public/index.html

动态路由:http://127.0.0.1:8081/dynamic/test

挂载路由:http://127.0.0.1:8081/mount/weibos

术语

koa 基于 Node.js 平台的下一代 web 开发框架

中间件,类似于水管管道,水从一个方向流向另一个方向,中间件好比从中间接了一根水管,控制水流,监测水流等操作

jsonwebtoken

由Header(头部),主要包括加密算法和加密类型,
Payload(负载),主要包括,发行者,过期时间,发行时间,业务数据等等
Signature(签名),主要是对前两部分的签名,防止数据篡改