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 🙏

© 2025 – Pkg Stats / Ryan Hefner

exposedjs

v0.7.5

Published

Achieve nodejs Intranet penetration

Downloads

7

Readme

exposedjs

[TOC]

包名称:exposedjs(暴露)

包版本:0.7.5(测试版)

包功能:类似与内网穿透。

包依赖:socket.io

为什么要使用exposedjs?

​ 开发者想要把内网的服务器的资源映射到公网上去,开发者拥有一台公网的服务器。通过socketio建立双向通信,让后进行接口的转发,目前只能一对一映射,后面会映射多个内网服务器。

目录结构

exposedjs

​ |PrimaryServer.js——主服务(公网用)

​ |FollowServer.js——从服务(内网用)

怎么使用exposedjs?

一、准备

  • 一台公网服务器
  • 一台内网服务器

二、下载引入

npm i -S exposedjs
//下载包
const exp = require('exposedjs');
//引入主服务包

const exp = require('exposedjs/FollowServer'); 
//引入从服务包

三、公网服务器代码

const express = require("express");
const exp = require("exposedjs");

let app = express();
//如果填写了这个配置自动更改为https
// exp.config(,'sslPath',{
//     key:"./ssl/xxx",
//     cert:"./ssl/xx"
// })
exp.config('limit',100); //限制访问为100 默认10
exp.config('pm2',3)//该应用的pm2 id , id默认为0
exp.startService(app).listen(8000);
//实例化app,启动映射服务,监听8000端口

四、内网服务器代码

const exp = require("exposedjs/FollowServer");

exp.createSevice({
    host:"http://localhost",//远程主机
    port:8000//端口
});

exp.method("/sum1","get",(req,res)=>{
    //query:ajax data传值
    let sum = req.query.a+req.query.b;
    
    res.send(`${query.a}+${query.b}=${sum}`) ;//0.3.0修改
    //响应数据,返回到浏览器
});

exp.syncMethod();//同步

浏览器代码

let data = { a: Math.floor(Math.random() * 1000), b: Math.floor(Math.random() * 1000) };
console.log(data);

$.ajax({
     type: "GET",
     url: "/sum1",
     data,
     success: function (response) {
         console.log(response.msg);

     }
});

版本信息

0.7.0

增加https

0.6.1

修改若干bug

0.6.0

增加自动重启服务功能。(需要mp2支持)
增加简单的cookie功能。

0.4.0

优化服务器之间的传值对象,修改响应数据方式。(return {返回值} 修改为 res.send(返回值))
支持访问限制

0.3.0

实现大多数功能,修复大多数bug