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 🙏

© 2024 – Pkg Stats / Ryan Hefner

here-ssi

v0.1.6

Published

支持ssi的here本地服务

Downloads

4

Readme

here-ssi

NPM Version NPM Downloads MIT License

这是一款小巧好用的Node本地服务,用起来非常简单,安装后,直接在要启用服务的目录执行命令行here即可,支持SSI和less、sass文件编译输出,支持内置 browserify 解析,支持 CommonJS 语法和 JSX 语法。

by 拔赤

安装

sudo npm install -g here-ssi

使用

在你想要启动服务的目录中,执行here

高级用法

指定端口 8888

here -p 8888

或者

here --port 8888

默认端口是 3000

制定服务启动的跟路径

here -d test

或者

here --directory test

默认路径是 ./

不要默认打开浏览器

here -s

或者

here --silent

输出Log

here -v

或者

here --verbose

监听文件修改,一旦修改就刷新页面

here -w

或者

here --watch

语法支持

HTML 预发支持

这里的服务支持SSI(服务器包含)

<!--#include virtual="path/to/file.html" -->

这里的SSI支持引用一个线上资源

同时还支持lesssass文件的自动翻译,我访问一个.css文件,如果这个css文件不存在,则会自动查找对应的.scss.less文件,并解析后返回

为了兼容阿里内部项目,还支持TMS的引用(非阿里内部项目不建议使用):

 <!--TMS:/rgn/mytaobao_bk.html:TMS-->  

或者

<!--TMS:/rgn/mytaobao_bk.html,utf-8,41:TMS-->

此外还兼容 HTTP 标签使用

<!--HTTP:http://****.html,(utf-8|gbk):HTTP-->

JS 语法支持

CommonJS 规范

// a.js
exports.foo = 123;

// b.js
var foo = require('b.js').foo;

引用b.js,server 输出合并后的b.js

如果不希望 js 文件被解析为 CommonJS 和 JSX,则在引用 url 后加行开关commonjs=false即可,比如:

http://path/to/file.js?commonjs=fase

JSX 语法支持

ReactDOM.render(
	<h1 className="title">yyyyyy</h1>,
	document.getElementById('example')
);

翻译输出后:

ReactDOM.render(React.createElement(
	"h1",
	{ className: "title" },
	"yyyyyy"
), document.getElementById('example'));

如果不希望 js 被解析为 JSX,url后加上开关commonjs=false即可

注意

本地服务返回的文本文件格式为utf-8,如果是gbk会自动转换为utf-8的文本输出