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

lg-static-resource

v1.0.1

Published

静态资源管理

Downloads

3

Readme

static-resource

静态资源管理

第一步:安装工具

这个命令行小工具依赖 nodejs 环境,因此,请先确保本地安装了它。

使用 nodejs 随带的 npm 包管理工具进行安装:

npm install -g lg-static-resource

第二步:创建项目

mkdir rsd-project
cd rsd-project

在项目根目录下创建一个空的 fis-conf.js 文件,空着就行。

然后开始在项目目录下,建自己的文件目录!

第三步:发布代码

在项目根目录下执行:

lgrsd release --md5 --dest ../output

然后去到 ../output 目录下去查看一下产出结果吧,所有静态资源都以md5摘要形式发布了出来,所有资源链接,我说 所有链接,包括html中的图片、样式、脚本以及js中的资源地址、css中的资源地址全部都加上了md5戳。

上述命令中,--md5 就是表示要给所有资源定位标记加上摘要信息的意思,不加这个参数就没有摘要信息处理。--dest ../output 表示把代码发布到当前目录上一级的output目录中。整个这条命令还可以简写成:

lgrsd release -md ../output

把代码发布指定位置:

lgrsd release -md d:\wwwroot

如果你本地没有安装任何服务器,你可以使用lg-static-resource内置的调试服务器,执行命令:

lgrsd server start

接下来我们同样要把代码发布到这个内置服务器中,release命令如果省略 --dest <path>参数,就表示把代码发布到内置服务器的根目录下:

lgrsd release -m

在浏览器中访问: http://localhost:8080 即可