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

uplos

v1.0.3

Published

A command line tool to sync local static files to oss

Downloads

281

Readme

uplos is a Node.js command tool for deploy static site to oss(aliyun).

install

npm i uplos -g

init

uplos init

this will generate a file named uplos.config.json, don't forget to add it to .gitignore file.

deploy

after complete configuration, you can deploy your project

uplos deploy

the result will like following

this demo has two actions(upload some files to one oss and some files to another oss).

before upload, uplos will check the files first, included

  • local files shoud be uploaded this time.
  • local files shoud be uploaded but has exist on remote and not changed.
  • local files has been deleted and should delete remoted files also.

after you confirm, just enter y to continue deploy

configuration

{
    "actions": [
        {
            "name": "sync data", // action name
            "oss": "aliyun", // now support only aliyun
            "auth": {
                "accessKeyId": "xxx",
                "accessKeySecret": "xxx",
                "bucket":"xxx",
                "region":"xxx"
            },
            "local": "./", // local folder
            "remote": "./", // remote folder
            "remove_prefix": "", // prefix should remove at remote
            "ignore": ["node_modules"],
            "whitelist": [],
        }
    ] 
}

local and remote path

local and remote can determine the root folder. for example the following local file structure

src
    - main.js
dist
    - index.html

default config

{
    "local": "./", 
    "remote": "./"
}

will lead [local => remote]

src/main.js => src/main.js
dist/index.html  =>  dist/index.html

but if you change your config like following

{
    "local": "./dist", 
    "remote": "./"
}

the result will be

dist/index.html  =>  dist/index.html

because we just want deplot ./dist folder, not include src folder.

if the oss have muilt usecase, you should deploy this project to remote web folder, you can change the config like this

{
    "local": "./dist", 
    "remote": "./web"
}

will lead

dist/index.html  =>  web/dist/index.html

It seems a bit off. The result we need is web/index.html, not web/dist/index.html. By defualt, local folder will upload into remote folder directly, if you want to remove the prefix, you can add remove_prefix

{
    "local": "./dist", 
    "remote": "./web",
    "remove_prefix": "dist"
}

then you can ge

dist/index.html  =>  web/index.html

ignore and whitelist

perhaps you have the project following

package.json
src
    - main.js
product
    - a
        - README.md
        - download.zip
    - b
        - README.md
        - download.zip
    - c
        - README.md
        - download.zip

all files will be uploaded default. if you want to ingore some files, for example package.json, you can add it to ignore field

{
    "ignore": ["package.json"]
}

Let's look at another complex scenario, you need upload only all download.zip files, Using ignore to achieve this would be quite strenuous, now you can use whitelist

{
    "whitelist": ["download.zip"]
}

will include all download.zip files

product/a/download.zip
product/b/download.zip
product/c/download.zip

now, I want exclude product/b/download.zip, then you can add ignore

{
    "whitelist": ["download.zip"],
    "ignore": ["product/b/download.zip"]
}

so, ignore can work with whitelist together, the value is a array, and the grammar is like your .gitignore, so the following is also work

{
    "whitelist": ["**/download.zip"],
    "ignore": ["b/download.zip"]
}