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

@tnnevol/alioss

v5.2.5-beta.4

Published

一个用于上传文件到阿里云oss的工具

Downloads

8

Readme

@tnnevol/alioss

本项目是对 ali-oss 的二次集成,主要用于 nodejs 环境。

CODE

alioss

安装

# global
pnpm add @tnnevol/alioss -g

# project dev
pnpm add @tnnevol/alioss -D

使用

# 初始化项目
alioss init

# 上传
alioss upload

# 更换oss配置后需要重新加密
alioss encrypt

描述

使用 alioss init 初始化项目后,会在脚本运行的目录下创建 alioss.config.js.osskey.js.ossignore文件。

// .osskey.js
// 每次初始化都会随机生成,此文件在项目中请不要上传,请将文件加入项目的ignore配置中,例如:.gitignore。
// 用于对alioss的原文配置进行加密,防止oss配置泄漏
module.exports = {
  key: "", // 加密key
  iv: "" // 加密iv
}

对于 aliossOptions 请参阅 oss node配置项

// alioss.config.js
const {key, iv} = require("./.osskey.js")
module.exports = {
  key, // 加密key
  iv, // 加密iv
  localDir:"", // 本地需要上传的目录
  remoteDir:"", // alioss 的目录
  aliossOptions:{ // alioss的必要参数
    region: "",
    accessKeyId: "",
    accessKeySecret: "",
    bucket: ""
  }
}

文件配置请参阅 ignore,.ossignore 内容会加入到 add 方法中,文件可使用 # 作为注释。

# .ossignore
# 用于忽略上传的文件

# 忽略e2e文件夹下的所有文件
dist/e2e/*
# e2e下的plugins目录必须上传
!dist/e2e/plugins

后期 aliossOptions 配置项参数发生变化可使用 alioss encrypt 对变更后的明文重新加密,shell 会使用现有项目 .osskey.js 文件中的 keyiv 进行加密;也可以将项目中的 alioss.config.js 删除,重新初始化。

feature

  • Node.js上传本地文件
  • 校验本地文件,oss是否已存在