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

express-static-web

v0.0.18

Published

express为基础的静态服务器

Downloads

27

Readme

express-web 一个静态服务器

NPM version

在前端项目要发布测试与生产环境,一般情况都会将打包好资源文件,使用nginx或tomcat等方式 进行本地验证,验证通过再进行线上部署。那有更便捷验证方式?就是express-web,详情使用请看 下文。

必要条件

使用之前必须保证已经安装好node>=8.10.0与npm>=6.1.0

特性

  1. 支持自定义端口
  2. 支持gzip
  3. 支持缓存

使用说明

npm安装使用

  1. npm i express-static-web --save-dev
  2. 在package.json的script中添加
     "scripts": {
        "preserver": "npm run build",
        "server": "cross-env Port=3001 Open=true Folder=dist express-static-web dev",
     }
  3. npm run server 启动
  
  备注: 
        preserver: 在npm run server之前执行打包命令
        Port: 端口号
        Open: 是否自动打开浏览器
        Folder: 打包之后文件夹名称

用于在服务器上部署前端项目

  1. 安装pm2: npm install -g  pm2
  2. 克隆本项目: git clone https://github.com/liu927971519/expresss-web.git
  3. 将打包好的部署文件放在dist文件夹
  4. 启动: npm run start 或 PORT=端口号 npm run start

若有使用上问题或bug,欢迎在Issues提出