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

@mankeheaven/oss-publish

v1.6.0

Published

publish static resources to oss

Readme

oss-publish

发布静态资源到oss上,支持命令行方式,或者调用主程序入口

目前支持阿里云oss, s3(aws和浪潮云,阿里云也可以用type:"s3",需要endpoint)

如何使用

  1. 安装
npm install @mankeheaven/oss-publish --save-dev
  1. 命令行发布使用方式 编写配置文件oss-publish.json, 目前仅支持json配置文件
{
  "type": "ali", //ali或者s3
  "accessKeyId": "your ak id",
  "accessKeySecret": "your ak secret",
  "bucket": "your bucket name",
  "region": "your region", //例如:oss-cn-shanghai
  "baseDir": "build", //你要发布的目录,dist or build or other...
  "clearBeforePublish": true, //是否先清空
  "defaultWebsiteEntry": "index.html", //如果有html,默认首页入口
  "errorWebsiteEntry": "404.html", //可以用来自定义404页面,默认是error.html
  "supportSubDir": true, //子目录首页, type为s3时候,不支持
}

或者配置文件改名字,xxx.json

编写scripts脚本,如果你的配置名称就是oss-publish.json,可以省略--config

oss-publish --config xxx.json

另外,需要access_key_id,access_key_secret,这两者会优先从process.env上拿,如果你想通过ci来发布,可以在ci上设置这两个值为环境变量

如果你想本地发布,可以配置~/.fcli/config.yaml文件, 优先级低于环境变量,如果是s3, 配置~/.fcli/s3-config.yaml

access_key_id: "your ak id"
access_key_secret: "your ak seceret"
  1. 程序使用方式
import ossPublish from '@mankeheaven/oss-publish';

ossPublish({
  "type": "s3",
  "accessKeyId": "your ak id",
  "accessKeySecret": "your ak secret",
  "bucket": "your bucket name",
  "region": "your region", //例如:oss-cn-shanghai,
  "endpoint": "https://oss-cn-hangzhou.aliyuncs.com",
  "baseDir": "build", //你要发布的目录,dist or build or other...
  "clearBeforePublish": true, //是否先清空
  "defaultWebsiteEntry": "index.html", //如果有html,默认首页入口
  "errorWebsiteEntry": "404.html", //可以用来自定义404页面,默认是error.html
  "supportSubDir": true, //子目录首页, type为s3时候,不支持
  "poolLimit": 50, // 上传池最大限制
  "poolTimeout: 10000 //上传超时
})

注意

阿里云如果是想访问静态html, 必须配置自定义域名

TODO

  • [ ] 支持ts
  • [ ] schema做验证