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

upload-to-oss

v2.1.0

Published

'watch local changed files,then,upload to ali oss.'

Downloads

8

Readme

upload-to-oss

** 前端静态资源检测,并上传到阿里云的oss **

============================

说明


  • watcher.js 负责记录修改的文件,写入记录文件中, 需要一开始就开启
  • upload.js 负责读取记录文件里的记录,然后上传到oss
  • upload.js 会查找监测文件夹下所有与记录同名的文件,目的是解决,前端静态资源压缩后,把压缩后的资源一同上传到oss
  • config.js 负责读取配置文件
  • 记录里面路径都采用绝对路径,暂不支持window

如何使用


第一次执行watcher的时候,会在项目根目录下创建配置文件: .upOssConfig

{
  "configFileName": ".upOssConfig",
  "basePath": "",
  "watchPath": "",
  "recordFileName": ".record",
  "uploadType": "",
  "oss": {
    "region": "",
    "accessKeyId": "",
    "accessKeySecret": "",
    "bucket": ""
  },
  "ignores": [".record",".upOssConfig","node_modules/",".idea/",".git/"],
  "autoSave": 10
}
  • configFileName: 配置文件名 默认:upOssConfig.json
  • basePath: 根目录的绝对路
  • watchPath: 监测文件的绝对路径,默认: 为配置文件所在的文件夹
  • uploadType: 文件上传方式, 默认: 全部对应上传; 1.assetsToAssets 本地_assets文件上传到oss的_assets下面 2.normalToAssets 本地检测文件上传到oss的_assets下面 3. 全部对应上传
  • recordFileName: 监测结果记录文件名,默认:.record
  • oss: 阿里对象存储
  • ignores: 忽略文件或文件名
  • autoSave: 自动保存的时间间隔(单位: s 秒),默认: 20s

启动监测


node xxxx/upload-to-oss/watcher [-p 'xx/xx']

###上传到oss

node xxxx/upload-to-oss/upload [-t 'normal']

注意


  • 请不要删除配置文件和记录文件,否则程序可能无法正确执行
  • 配置文件修改后,请重启watcher.js,否则无法生效