Important notes:
- upload a directory and its sub-directories recursively;
- could be an absolute or relative path to a directory;
params
andoptions
are the same as in the AWS documentation so theses functions are very flexible;rootKey
is the root AWS key to use, by default it is the S3 root, e.g. sayingrootKey
ispublic
and you want to upload/Users/you/my-project/images
, files will be uploaded tos3://bucket/public/images
;aws-sdk
will automatically check forAWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
environment variables, it is the safest way to deal with credentials imo;- without clustering I found uploading a directory of 1254 files was nearly 2 times faster than the native AWS CLI
sync
method (it's Python underneath, Node.js should be faster); - don't forget to add file's content-type, mostly for static websites, or i