1.0.9 • Published 2 years ago

osspub v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

osspub

a npm tool that can upload files or directories to aliyun-oss server.

Please prepare an .osspub.json configuration file to configure your Appkey, and AppSecret.

.osspub.json file

{
  "accessKeyId": "yourkeyid",
  "accessKeySecret": "yourkeysecret",
}

basic usage:

npm install --save osspub
osspub ${BUCKET_NAME} ${OSS_PATH} ${YOUR_FILE_OR_DIRECTORY}

In addition, the priority of a given file can be determined in the configuration file. By default all files have infinitely high priority. If you specify the priority of certain files, these files will be uploaded after others, and they will be uploaded according to their priority. higher pri will be uploaded first.

example

{
  "files_pri":
  {
    "index.html":0,
    "index.js":1,
    "version.json":2,
  }
}

the configure file also supports file blacklisting mode:

{
  "excludes":[".DS_Store", ".svn"]
}

By default, osspub turns on the upload logging. You can turn it off with logoff = TURE

{
  "logoff":true
}

Maybe sometimes, you only want to upload the files under the first level folder. So the configuration file also provides the limits of the level. By default, the limit is 20.

{
  "nest":20
}

Osspub push files concurrently and asynchronously by using Promise.all, so that it can save handshake wait time. you can configure this concurrent number by setting the 'batch' value, the default is 10

{
  "batch":20
}

Osspub provides the ability to remove the prefix path.

{
  "remove_prefix": true
}

The tool also provides a tagging function. You can set specific tags for special files or set default tags for all files.

{
  "headers":
  {
    "some_files":{
      "x-oss-tagging": "TagA=A&TagB=B"
    },
    "default":{
      "x-default": "foo"
    }
  }
}

MIME configurations are similar to nginx configurations, see the following example.

{
  "mime": {
      "types": {
          ".sk": "text/plain"
      }
  }
}

Hope you enjoy it.

1.0.9

2 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago