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

ss-server

v0.0.34

Published

Readme

ss-server.js

功能简介

设置指定目录为该端口下的服务器根目录

安装

$ npm install ss-server

运行

$ ss-server run [dir] [port] [runtime]  [-d <dir>] [-p <port>] [-r <runtime>]

说明

[dir] 目录为controller 和 view 根目录 默认值为当前执行路径
[port]端口 默认值为3000
[runtime] 可以指定(供部使用的静态页面根目录) 默认值为./


-d <dir> -p <port> -r <runtime> 用于单独替换前面三个参数


例如:

    $ ss-server run 'C:/a' 3000 'runtime'

    http://localhost:3000   对应到 C:/a/runtime/index.html (主要是静态内容存放路径)

    http://localhost:3000/home 对应到 C:/a/view/home/index.html(动态生成的文件路径)

    http://localhost:3000/home/a 对应到 C:/a/view/home/a.html(动态生成的文件路径)

可以controller目录下创建对应的home.js 来复写默认的内容


例如:
 home.js
module.exports={
    action:function(querystring,from,files){
        var response=this.response;
        var request=this.request;
        response.writeHead(200, {'Content-Type': 'text/plain'});
        response.write('success');
        response.end();
        //do something
    },
    //该方法返回指定模板下的内容
    action1:function(querystring){
        return this.render.view('view目录下的html',querystring)
        //return this.render.view(querystring)
                //return this.render.view();
    },
    //该方法返回json数据
    action2:function(){
        return this.render.json({a:1,b:1})
    },
    action3:function(){
        return this.render.tpl("字符串的模板",{a:1,b:2,querystring:arguments[0],formdata:qrguments[1]});
    }
});

关于模板

简易的js模板类似asp
<%逻辑语句%>
<%=取值%>