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

osser

v1.2.0

Published

a command line interface for alioss

Downloads

3

Readme

osser

Provide multi-mode Alibaba Cloud OSS interactive command line upload tool

Build Status NPM Version

Read in other languages: English | 简体中文

Install

#Global install dependency
npm install -g osser

#Check the version number
osser -v

Add configuration file

You need to put an oss initialization configuration file osser.js or osser.json in the project root directory.

AccessKey must be configured before it can be used normally.

Configuration Item Reference Link

module.exports = {
  //Required oss configuration items
  //Reference: https://help.aliyun.com/document_detail/64097.html
  region: "",
  accessKeyId: "",
  accessKeySecret: "",
  bucket: "",

  //Optional configuration items for upload request
  fetchOptions: {
    timeout: 100 * 1000,
  },
};

glob pattern

Use glob pattern to match all files that need to be uploaded

# Specify to upload all files in the dist folder of the local current directory to the root path of the remote oss bucket
osser --glob dist/**/*

# Can be abbreviated with -g
osser -g dist/**/*

Multiple glob strings can be used to match files:

osser -g dist/**/* static/**/*.png 

The matching path contains a relative path, and all matched files will be uploaded directly to the specified remote path, and folders will not be recursively created to store these files:

osser -g ../dist/**/*
# For example: (matching character contains relative path../, ./, / etc.)
# The matched file name is: ../dist/mode/name.js
# The path to upload to oss is: name.js
osser -g ../dist/**/* -d xiaohong 
# The matched file name is: ../dist/mode/name.js
# The path to upload to oss is: xiaohong/name.js

If the same file is matched, it will be deduplicated:

osser -g **/** dist/**
# At this time, it will definitely match the same file, then perform de-duplication processing

You can use the --dir option to specify the bucket root directory for uploading oss:

# At this time, the matched files will be uploaded with xiaoming as the root directory
osser -g dist/**/* --dir xiaoming
# For example:
# The matched file name is: dist/mode/name.js
# The path to upload to oss is: xiaoming/dist/mode/name.js

Use the --hash option to add a hash value to the uploaded file name:

osser -g dist/**/* --hash
# The default is an eight-digit hash value
# dist/mode/name_d8jy7cz1.js

osser -g dist/**/* -h 4
# You can also specify the number of hash palce
# dist/mode/name_d8jy.js 

Use the --time option to add a timestamp to the uploaded file name:

osser -g dist/**/* --time
# dist/mode/name_20210828121131.js 

# You can also use the -t abbreviation
osser -g dist/**/* -t

# You can also specify the hash value and timestamp at the same time
osser -g dist/**/* -t -h
# dist/mode/name_d8jy7cz1_20210828121131.js