{"_id":"e-ali-oss","name":"e-ali-oss","dist-tags":{"latest":"6.21.0"},"versions":{"6.21.0":{"name":"e-ali-oss","version":"6.21.0","description":"aliyun oss(object storage service) node client","main":"./lib/client.js","browser":{"./lib/client.js":"./dist/aliyun-oss-sdk.js","mime":"mime/lite","urllib":"./shims/xhr.js","utility":"./shims/utility.js","crypto":"./shims/crypto/crypto.js","debug":"./shims/debug","fs":false,"child_process":false,"is-type-of":"./shims/is-type-of.js"},"scripts":{"build-change-log":"standard-version","test":"npm run tsc && mocha -t 120000 -r should -r dotenv/config test/node/*.test.js test/node/**/*.test.js","test-cov":"npm run tsc && nyc --reporter=lcov node_modules/.bin/_mocha -t 120000 -r should test/node/*.test.js test/node/**/*.test.js","jshint":"jshint .","build-test":"mkdir -p ./test/browser/build && MINIFY=1 node browser-build.js > test/browser/build/aliyun-oss-sdk.min.js && node -r dotenv/config task/browser-test-build.js > test/browser/build/tests.js","browser-test":"npm run build-test && karma start","build-dist":"npm run tsc && node browser-build.js > dist/aliyun-oss-sdk.js && MINIFY=1 node browser-build.js > dist/aliyun-oss-sdk.min.js","publish-to-npm":"node publish-npm-check.js && npm publish","publish-to-cdn":"node publish.js","snyk-protect":"snyk-protect","lint-staged":"lint-staged","detect-secrets":"node task/detect-secrets","tsc":"npm run tsc:clean && npm run tsc:build","tsc:build":"tsc -b tsconfig.json tsconfig-cjs.json","tsc:watch":"tsc -b tsconfig.json tsconfig-cjs.json --watch","tsc:clean":"tsc -b tsconfig.json tsconfig-cjs.json --clean ","prepare":"husky install"},"git-pre-hooks":{"pre-release":"npm run build-dist","post-release":["npm run publish-to-npm","npm run publish-to-cdn"]},"homepage":"https://github.com/ali-sdk/ali-oss","bugs":{"url":"https://github.com/ali-sdk/ali-oss/issues"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"repository":{"type":"git","url":"git+https://github.com/ali-sdk/ali-oss.git"},"keywords":["oss","client","file","aliyun"],"author":{"name":"dead_horse"},"license":"MIT","engines":{"node":">=8"},"devDependencies":{"@alicloud/openapi-client":"^0.4.10","@alicloud/resourcemanager20200331":"^2.3.0","@alicloud/tea-util":"^1.4.9","@babel/core":"^7.11.6","@babel/plugin-transform-regenerator":"^7.10.4","@babel/plugin-transform-runtime":"^7.11.5","@babel/preset-env":"^7.11.5","@babel/runtime":"^7.11.2","@commitlint/cli":"^17.6.7","@commitlint/config-conventional":"^16.2.4","@octokit/core":"^5.0.0","@semantic-release/exec":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^10.0.5","@snyk/protect":"^1.1196.0","@types/node":"^14.0.12","@typescript-eslint/eslint-plugin":"^5.0.0","@typescript-eslint/parser":"^5.0.0","aliasify":"^2.0.0","axios":"0.27.2","babelify":"^10.0.0","beautify-benchmark":"^0.2.4","benchmark":"^2.1.1","bluebird":"^3.1.5","browserify":"^17.0.0","core-js":"^3.6.5","crypto-js":"^3.1.9-1","dotenv":"^8.2.0","eslint":"^8.44.0","eslint-config-airbnb":"^19.0.4","eslint-config-ali":"^13.0.0","eslint-config-prettier":"^8.8.0","eslint-plugin-import":"^2.21.1","eslint-plugin-jsx-a11y":"^6.0.3","eslint-plugin-prettier":"^4.2.1","filereader":"^0.10.3","form-data":"^4.0.0","git-pre-hooks":"^1.2.0","husky":"^7.0.4","immediate":"^3.3.0","karma":"^6.3.4","karma-browserify":"^8.1.0","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.0.1","karma-ie-launcher":"^1.0.0","karma-mocha":"^2.0.1","karma-safari-launcher":"^1.0.0","lint-staged":"^12.4.1","mm":"^2.0.0","mocha":"^9.1.2","nyc":"^15.1.0","prettier":"^3.0.0","promise-polyfill":"^6.0.2","puppeteer":"19.0.0","semantic-release":"^21.1.1","should":"^11.0.0","sinon":"^15.2.0","standard-version":"^9.3.1","stream-equal":"^1.1.0","timemachine":"^0.3.0","typescript":"^4.4.4","uglify-js":"^3.14.2","watchify":"^4.0.0"},"dependencies":{"address":"^1.2.2","agentkeepalive":"^3.4.1","bowser":"^1.6.0","copy-to":"^2.0.1","dateformat":"^2.0.0","debug":"^4.3.4","destroy":"^1.0.4","end-or-error":"^1.0.1","get-ready":"^1.0.0","humanize-ms":"^1.2.0","is-type-of":"^1.4.0","js-base64":"^2.5.2","jstoxml":"^2.0.0","lodash":"^4.17.21","merge-descriptors":"^1.0.1","mime":"^2.4.5","platform":"^1.3.1","pump":"^3.0.0","qs":"^6.4.0","sdk-base":"^2.0.1","stream-http":"2.8.2","stream-wormhole":"^1.0.4","urllib":"^2.44.0","utility":"^1.18.0","xml2js":"^0.6.2"},"snyk":true,"lint-staged":{"**/!(dist)/*":["npm run detect-secrets --"],"**/*.{js,ts}":["eslint --cache --fix --ext .js,.ts","prettier --write","git add"]},"_id":"e-ali-oss@6.21.0","contributors":[{"name":"PeterRao","email":"peizerao@gmail.com","url":"https://github.com/PeterRao"},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"chunpu","email":"fengtong@mail.ustc.edu.cn"},{"name":"fengmk2","email":"m@fengmk2.com","url":"https://github.com/fengmk2"},{"name":"Yan Qing","email":"admin@zensh.com","url":"https://github.com/zensh"},{"name":"mars-coder","email":"mars.ll@alibaba-inc.com","url":"https://github.com/mars-coder"},{"name":"Jacky Tang","email":"jackytck@gmail.com","url":"https://github.com/jackytck"}],"gitHead":"07ce713faeec066dfb7cf4bda45a5d0264a22f30","_nodeVersion":"22.4.1","_npmVersion":"9.9.2","dist":{"integrity":"sha512-uYPuLcQIClV5FEtsx2EV0W1k+6G8bfFxYuM4n0W2gPtQ3Iek/X+BsrRnLOQnlsu38I0vhdYkh3Aso+i2d24VzA==","shasum":"24cd54a903f417adc8c57fa2c37cf16d5c1def30","tarball":"https://registry.npmjs.org/e-ali-oss/-/e-ali-oss-6.21.0.tgz","fileCount":233,"unpackedSize":2725529,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwXfSTbiCaOox5pbUqY7JC8+i+IoBMPgkvcVuhtlyoFgIgFj7BHJsZkAhYQI9lV7S3W5rUHDTcUA1V0catJhSBWcI="}]},"_npmUser":{"name":"evilstorm","email":"evils@evils.cc"},"directories":{},"maintainers":[{"name":"evilstorm","email":"evils@evils.cc"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/e-ali-oss_6.21.0_1724676876554_0.4687330770600675"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-26T12:54:36.466Z","6.21.0":"2024-08-26T12:54:36.841Z","modified":"2024-08-26T12:54:37.087Z"},"maintainers":[{"name":"evilstorm","email":"evils@evils.cc"}],"description":"aliyun oss(object storage service) node client","homepage":"https://github.com/ali-sdk/ali-oss","keywords":["oss","client","file","aliyun"],"repository":{"type":"git","url":"git+https://github.com/ali-sdk/ali-oss.git"},"contributors":[{"name":"PeterRao","email":"peizerao@gmail.com","url":"https://github.com/PeterRao"},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"chunpu","email":"fengtong@mail.ustc.edu.cn"},{"name":"fengmk2","email":"m@fengmk2.com","url":"https://github.com/fengmk2"},{"name":"Yan Qing","email":"admin@zensh.com","url":"https://github.com/zensh"},{"name":"mars-coder","email":"mars.ll@alibaba-inc.com","url":"https://github.com/mars-coder"},{"name":"Jacky Tang","email":"jackytck@gmail.com","url":"https://github.com/jackytck"}],"author":{"name":"dead_horse"},"bugs":{"url":"https://github.com/ali-sdk/ali-oss/issues"},"license":"MIT","readme":"# oss-js-sdk\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![coverage][cov-image]][cov-url]\n[![David deps][david-image]][david-url]\n\n[npm-image]: https://img.shields.io/npm/v/ali-oss.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/ali-oss\n[travis-image]: https://img.shields.io/travis/ali-sdk/ali-oss/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/ali-sdk/ali-oss.svg?branch=master\n[cov-image]: http://codecov.io/github/ali-sdk/ali-oss/coverage.svg?branch=master\n[cov-url]: http://codecov.io/github/ali-sdk/ali-oss?branch=master\n[david-image]: https://img.shields.io/david/ali-sdk/ali-oss.svg?style=flat-square\n[david-url]: https://david-dm.org/ali-sdk/ali-oss\n\naliyun OSS(Object Storage Service) js client for Node and Browser env.\n\n`NOTE`： For SDK `5.X` document, please go to [README.md](https://github.com/ali-sdk/ali-oss/blob/5.x/README.md)\n\n## Install\n\n```bash\nnpm install ali-oss --save\n```\n\n## Compatibility\n\n### Node\n\nNode.js >= 8.0.0 required. You can use 4.x in Node.js < 8.\n\n### Browser\n\n- IE >= 10 & Edge\n- Major versions of Chrome/Firefox/Safari\n- Major versions of Android/iOS/WP\n\n`Note`:\n\n- For Lower browsers you can refer to [PostObject](https://help.aliyun.com/document_detail/31988.html), if you want to see more practices ,please refer to [Web Post](https://help.aliyun.com/document_detail/31923.html)\n\n### QA\n\nYou can join DingDing Talk Group, [Group Link](https://qr.dingtalk.com/action/joingroup?code=v1,k1,E60EuCmxajfilkaR/kknRcGR9UissskPEXu/1td36z0=)\n\n<img src=\"task/dingding.jpg\" height=\"400\" title=\"dingding\" width=\"300\">\n\n## License\n\n[MIT](LICENSE)\n\n# OSS Usage\n\nOSS, Object Storage Service. Equal to well known Amazon [S3](http://aws.amazon.com/s3/).\n\nAll operation use es7 async/await to implement. All api is async function.\n\n## Summary\n\n- [Node Usage](#node-usage)\n- [Browser Usage](#browser-usage)\n- [Data Regions](#data-regions)\n- [Create Account](#create-account)\n- [Create A Bucket Instance](#create-a-bucket-instance)\n  - [oss(options)](#ossoptions)\n- [Bucket Operations](#bucket-operations)\n\n  - Base\n    - [.listBuckets(query[, options])](#listbucketsquery-options)\n    - [.putBucket(name[, options])](#putbucketname-options)\n    - [.useBucket(name)](#usebucketname)\n    - [.deleteBucket(name[, options])](#deletebucketname-options)\n    - [.getBucketInfo(name)](#getbucketinfoname)\n    - [.getBucketStat(name)](#getbucketstatname)\n    - [.getBucketLocation(name)](#getbucketlocationname)\n  - ACL\n    - [.putBucketACL(name, acl[, options])](#putbucketaclname-acl-options)\n    - [.getBucketACL(name[, options])](#getbucketaclname-options)\n  - Logging\n    - [.putBucketLogging(name, prefix[, options])](#putbucketloggingname-prefix-options)\n    - [.getBucketLogging(name[, options])](#getbucketloggingname-options)\n    - [.deleteBucketLogging(name[, options])](#deletebucketloggingname-options)\n  - Website\n    - [.putBucketWebsite(name, config[, options])](#putbucketwebsitename-config-options)\n    - [.getBucketWebsite(name[, options])](#getbucketwebsitename-options)\n    - [.deleteBucketWebsite(name, region[, options])](#deletebucketwebsitename-options)\n  - Referer\n    - [.putBucketReferer(name, allowEmpty, referers[, options])](#putbucketreferername-allowempty-referers-options)\n    - [.getBucketReferer(name[, options])](#getbucketreferername-options)\n    - [.deleteBucketReferer(name[, options])](#deletebucketreferername-options)\n  - Lifecycle\n    - [.putBucketLifecycle(name, rules[, options])](#putbucketlifecyclename-rules-options)\n    - [.getBucketLifecycle(name[, options])](#getbucketlifecyclename-options)\n    - [.deleteBucketLifecycle(name[, options])](#deletebucketlifecyclename-options)\n  - CORS\n    - [.putBucketCORS(name, rules[, options])](#putbucketcorsname-rules-options)\n    - [.getBucketCORS(name[, options])](#getbucketcorsname-options)\n    - [.deleteBucketCORS(name[, options])](#deletebucketcorsname-options)\n  - RequestPayment\n    - [.getBucketRequestPayment(bucketName[, options])](#getbucketrequestpaymentbucketname-options)\n    - [.putBucketRequestPayment(bucketName, payer[, options])](#putBucketRequestpaymentbucketname-payer-options)\n  - BucketEncryption\n    - [.putBucketEncryption(name[, rules])](#putbucketencryptionname-rules)\n    - [.getBucketEncryption(name)](#getbucketencryptionname)\n    - [.deleteBucketEncryption(name)](#deletebucketencryptionname)\n  - tagging\n    - [.putBucketTags(name, tag[, options])](#putBucketTagsname-tag-options)\n    - [.getBucketTags(name, [, options])](#getBucketTagsname-options)\n    - [.deleteBucketTags(name, [, options])](#deleteBucketTagsname-options)\n  - policy\n    - [.putBucketPolicy(name, policy[, options])](#putBucketPolicyname-policy-options)\n    - [.getBucketPolicy(name, [, options])](#getBucketPolicyname-options)\n    - [.deleteBucketPolicy(name, [, options])](#deleteBucketPolicyname-options)\n  - versioning\n    - [.getBucketVersioning(name, [, options])](#getBucketVersioningname-options)\n    - [.putBucketVersioning(name, status[, options])](#putBucketVersioningname-status-options)\n  - inventory\n    - [.getBucketInventory(name, inventoryId[, options])](#getBucketInventoryname-inventoryid-options)\n    - [.putBucketInventory(name, inventory[, options])](#putBucketInventoryname-inventory-options)\n    - [.deleteBucketInventory(name, inventoryId[, options])](#deleteBucketInventoryname-inventoryid-options)\n    - [.listBucketInventory(name, [, options])](#listBucketInventoryname-options)\n  - worm\n    - [.abortBucketWorm(name[, options])](#abortBucketWormname-options)\n    - [.completeBucketWorm(name, wormId[, options])](#completeBucketWormname-wormId-options)\n    - [.extendBucketWorm(name, wormId, days[, options])](#extendBucketWormname-wormId-days-options)\n    - [.getBucketWorm(name[, options])](#getBucketWormname-options)\n    - [.initiateBucketWorm(name, days[, options])](#initiateBucketWormname-days-options)\n\n- [Object Operations](#object-operations)\n  - [.list(query[, options])](#listquery-options)\n  - [.listV2(query[, options])](#listV2query-options)\n  - [.getBucketVersions(query[, options])](#getBucketVersionsquery-options)\n  - [.put(name, file[, options])](#putname-file-options)\n  - [.putStream(name, stream[, options])](#putstreamname-stream-options)\n  - [.append(name, file[, options])](#appendname-file-options)\n  - [.getObjectUrl(name[, baseUrl])](#getobjecturlname-baseurl)\n  - [.generateObjectUrl(name[, baseUrl])](#generateobjecturlname-baseurl)\n  - [.head(name[, options])](#headname-options)\n  - [.getObjectMeta(name[, options])](#getobjectmetaname-options)\n  - [.get(name[, file, options])](#getname-file-options)\n  - [.getStream(name[, options])](#getstreamname-options)\n  - [.delete(name[, options])](#deletename-options)\n  - [.copy(name, sourceName[, sourceBucket, options])](#copyname-sourcename-sourcebucket-options)\n  - [.putMeta(name, meta[, options])](#putmetaname-meta-options)\n  - [.deleteMulti(names[, options])](#deletemultinames-options)\n  - [.signatureUrl(name[, options])](#signatureurlname-options)\n  - [.asyncSignatureUrl(name[, options])](#signatureurlname-options)\n  - [.signatureUrlV4(method, expires[, request, objectName, additionalHeaders])](#signatureurlv4method-expires-request-objectname-additionalheaders)\n  - [.putACL(name, acl[, options])](#putaclname-acl-options)\n  - [.getACL(name[, options])](#getaclname-options)\n  - [.restore(name[, options])](#restorename-options)\n  - [.putSymlink(name, targetName[, options])](#putsymlinkname-targetname-options)\n  - [.getSymlink(name[, options])](#getsymlinkname-options)\n  - [.initMultipartUpload(name[, options])](#initmultipartuploadname-options)\n  - [.uploadPart(name, uploadId, partNo, file, start, end[, options])](#uploadpartname-uploadid-partno-file-start-end-options)\n  - [.uploadPartCopy(name, uploadId, partNo, range, sourceData[, options])](#uploadpartcopyname-uploadid-partno-range-sourcedata-options)\n  - [.completeMultipartUpload(name, uploadId, parts[, options])](#completemultipartuploadname-uploadid-parts-options)\n  - [.multipartUpload(name, file[, options])](#multipartuploadname-file-options)\n  - [.multipartUploadCopy(name, sourceData[, options])](#multipartuploadcopyname-sourcedata-options)\n  - [.listParts(name, uploadId[, query, options])](#listpartsname-uploadid-query-options)\n  - [.listUploads(query[, options])](#listuploadsquery-options)\n  - [.abortMultipartUpload(name, uploadId[, options])](#abortmultipartuploadname-uploadid-options)\n  - [.calculatePostSignature(policy)](#calculatePostSignaturepolicy)\n  - [.getObjectTagging(name, [, options])](#getObjectTaggingname-options)\n  - [.putObjectTagging(name, tag[, options])](#putObjectTaggingname-tag-options)\n  - [.deleteObjectTagging(name, [, options])](#deleteObjectTaggingname-options)\n- [RTMP Operations](#rtmp-operations)\n  - [.putChannel(id, conf[, options])](#putchannelid-conf-options)\n  - [.getChannel(id[, options])](#getchannelid-options)\n  - [.deleteChannel(id[, options])](#deletechannelid-options)\n  - [.putChannelStatus(id, status[, options])](#putchannelstatusid-status-options)\n  - [.getChannelStatus(id[, options])](#getchannelstatusid-options)\n  - [.listChannels(query[, options])](#listchannelsquery-options)\n  - [.getChannelHistory(id[, options])](#getchannelhistoryid-options)\n  - [.createVod(id, name, time[, options])](#createvodid-name-time-options)\n  - [.getRtmpUrl(channelId[, options])](#getrtmpurlchannelid-options)\n- [Create A Image Service Instance](#create-a-image-service-instance)\n  - [oss.ImageClient(options)](#ossimageclientoptions)\n- [Image Operations](#image-operations)\n  - [imgClient.get(name, file[, options])](#imgclientgetname-file-options)\n  - [imgClient.getStream(name[, options])](#imgclientgetstreamname-options)\n  - [imgClient.getExif(name[, options])](#imgclientgetexifname-options)\n  - [imgClient.getInfo(name[, options])](#imgclientgetinfoname-options)\n  - [imgClient.putStyle(name, style[, options])](#imgclientputstylename-style-options)\n  - [imgClient.getStyle(name[, options])](#imgclientgetstylename-options)\n  - [imgClient.listStyle([options])](#imgclientliststyleoptions)\n  - [imgClient.deleteStyle(name[, options])](#imgclientdeletestylename-options)\n  - [imgClient.signatureUrl(name)](#imgclientsignatureurlname)\n- [Known Errors](#known-errors)\n\n## Node Usage\n\n### Compatibility\n\n- Node: >= 8.0.0\n\n### Basic usage\n\n1.install SDK using npm\n\n```\nnpm install ali-oss --save\n```\n\n2.for example:\n\n```js\nconst OSS = require('ali-oss');\nconst store = new OSS({\n  region: '<oss region>',\n  accessKeyId: '<Your accessKeyId>',\n  accessKeySecret: '<Your accessKeySecret>',\n  bucket: '<Your bucket name>'\n});\n```\n\n## Browser Usage\n\nYou can use most of the functionalities of `ali-oss` in browser with\nsome exceptions:\n\n- put object with streaming: no chunked encoding, we use multipart\n  upload instead\n- get object to local file: we cannot manipulate file system in\n  browser, we provide signed object url for downloading needs\n- bucket operations(listBuckets, putBucketLogging, etc) will fail: OSS\n  server currently do not support CORS requests for bucket operations\n  (will probably be fixed later)\n\n### Compatibility\n\n- IE >= 10 & Edge\n- Major versions of Chrome/Firefox/Safari\n- Major versions of Android/iOS/WP\n  > Note: Because some browsers do not support promises, you need to introduce promise compatible libraries.<br>\n  > For example: IE10 and IE11 need to introduce a promise-polyfill.\n\n### Setup\n\n#### Bucket setup\n\nAs browser-side javascript involves CORS operations. You need to setup\nyour bucket CORS rules to allow CORS operations:\n\n- set allowed origins to '\\*'\n- allowed methods to 'PUT, GET, POST, DELETE, HEAD'\n- set allowed headers to '\\*'\n- expose 'ETag' in expose headers\n\n#### STS setup\n\nAs we don't want to expose the accessKeyId/accessKeySecret in the\nbrowser, a [common practice][oss-sts] is to use STS to grant temporary\naccess.\n\n### Basic usage\n\nInclude the sdk lib in the `<script>` tag and you have `OSS` available\nfor creating client.\n\n```html\n// x.x.x The specific version number represented // we recommend introducing offline resources, because the usability of\nonline resources depends on the stability of the cdn server.\n<!-- Introducing online resources -->\n<script src=\"http://gosspublic.alicdn.com/aliyun-oss-sdk-x.x.x.min.js\"></script>\n<!-- Introducing offline resources -->\n<script src=\"./aliyun-oss-sdk-x.x.x.min.js\"></script>\n\n<script type=\"text/javascript\">\n  const store = new OSS({\n    region: 'oss-cn-hangzhou',\n    accessKeyId: '<access-key-id>',\n    accessKeySecret: '<access-key-secret>',\n    bucket: '<bucket-name>',\n    stsToken: '<security-token>'\n  });\n\n  store\n    .list()\n    .then(result => {\n      console.log('objects: %j', result.objects);\n      return store.put('my-obj', new OSS.Buffer('hello world'));\n    })\n    .then(result => {\n      console.log('put result: %j', result);\n      return store.get('my-obj');\n    })\n    .then(result => {\n      console.log('get result: %j', result.content.toString());\n    });\n</script>\n```\n\nThe full sample can be found [here][browser-sample].\n\n### How to build\n\n```bash\nnpm run build-dist\n```\n\nAnd see the build artifacts under `dist/`.\n\n## Data Regions\n\n[OSS current data regions](https://help.aliyun.com/document_detail/31837.html).\n\n| region             | country   | city           | endpoint                        | internal endpoint                        |\n| ------------------ | --------- | -------------- | ------------------------------- | ---------------------------------------- |\n| oss-cn-hangzhou    | China     | HangZhou       | oss-cn-hangzhou.aliyuncs.com    | oss-cn-hangzhou-internal.aliyuncs.com    |\n| oss-cn-shanghai    | China     | ShangHai       | oss-cn-shanghai.aliyuncs.com    | oss-cn-shanghai-internal.aliyuncs.com    |\n| oss-cn-qingdao     | China     | QingDao        | oss-cn-qingdao.aliyuncs.com     | oss-cn-qingdao-internal.aliyuncs.com     |\n| oss-cn-beijing     | China     | BeiJing        | oss-cn-beijing.aliyuncs.com     | oss-cn-beijing-internal.aliyuncs.com     |\n| oss-cn-shenzhen    | China     | ShenZhen       | oss-cn-shenzhen.aliyuncs.com    | oss-cn-shenzhen-internal.aliyuncs.com    |\n| oss-cn-hongkong    | China     | HongKong       | oss-cn-hongkong.aliyuncs.com    | oss-cn-hongkong-internal.aliyuncs.com    |\n| oss-us-west-1      | US        | Silicon Valley | oss-us-west-1.aliyuncs.com      | oss-us-west-1-internal.aliyuncs.com      |\n| oss-ap-southeast-1 | Singapore | Singapore      | oss-ap-southeast-1.aliyuncs.com | oss-ap-southeast-1-internal.aliyuncs.com |\n\n## Create Account\n\nGo to [OSS website](http://www.aliyun.com/product/oss/?lang=en), create a new account for new user.\n\nAfter account created, you can create the OSS instance and get the `accessKeyId` and `accessKeySecret`.\n\n## Create A Bucket Instance\n\nEach OSS instance required `accessKeyId`, `accessKeySecret` and `bucket`.\n\n## oss(options)\n\nCreate a Bucket store instance.\n\noptions:\n\n- accessKeyId {String} access key you create on aliyun console website\n- accessKeySecret {String} access secret you create\n- [stsToken] {String} used by temporary authorization, detail [see](https://www.alibabacloud.com/help/doc-detail/32077.htm)\n- [refreshSTSToken] {Function} used by auto set `stsToken`、`accessKeyId`、`accessKeySecret` when sts info expires. return value must be object contains `stsToken`、`accessKeyId`、`accessKeySecret`\n- [refreshSTSTokenInterval] {number} use time (ms) of refresh STSToken interval it should be less than sts info expire interval, default is 300000ms(5min)\n- [bucket] {String} the default bucket you want to access\n  If you don't have any bucket, please use `putBucket()` create one first.\n- [endpoint] {String} oss region domain. It takes priority over `region`. Set as extranet domain name, intranet domain name, accelerated domain name, etc. according to different needs. please see [endpoints](https://www.alibabacloud.com/help/doc-detail/31837.htm)\n- [region] {String} the bucket data region location, please see [Data Regions](#data-regions),\n  default is `oss-cn-hangzhou`.\n- [internal] {Boolean} access OSS with aliyun internal network or not, default is `false`.\n  If your servers are running on aliyun too, you can set `true` to save a lot of money.\n- [secure] {Boolean} instruct OSS client to use HTTPS (secure: true) or HTTP (secure: false) protocol.\n- [timeout] {String|Number} instance level timeout for all operations, default is `60s`.\n- [cname] {Boolean}, default false, access oss with custom domain name. if true, you can fill `endpoint` field with your custom domain name,\n- [isRequestPay] {Boolean}, default false, whether request payer function of the bucket is open, if true, will send headers `'x-oss-request-payer': 'requester'` to oss server.\n  the details you can see [requestPay](https://help.aliyun.com/document_detail/91337.htm)\n- [useFetch] {Boolean}, default false, it just work in Browser, if true,it means upload object with\n  `fetch` mode ,else `XMLHttpRequest`\n- [enableProxy] {Boolean}, Enable proxy request, default is false. **_NOTE:_** When enabling proxy request, please ensure that proxy-agent is installed.\n- [proxy] {String | Object}, proxy agent uri or options, default is null.\n- [retryMax] {Number}, used by auto retry send request count when request error is net error or timeout. **_NOTE:_** Not support `put` with stream, `putStream`, `append` with stream because the stream can only be consumed once\n- [maxSockets] {Number} Maximum number of sockets to allow per host. Default is infinity\n- [authorizationV4] {Boolean} Use V4 signature. Default is false.\n\nexample:\n\n1. basic usage\n\n```js\nconst OSS = require('ali-oss');\n\nconst store = new OSS({\n  accessKeyId: 'your access key',\n  accessKeySecret: 'your access secret',\n  bucket: 'your bucket name',\n  region: 'oss-cn-hangzhou'\n});\n```\n\n2. use accelerate endpoint\n\n- Global accelerate endpoint: oss-accelerate.aliyuncs.com\n- Accelerate endpoint of regions outside mainland China: oss-accelerate-overseas.aliyuncs.com\n\n```js\nconst OSS = require('ali-oss');\n\nconst store = new OSS({\n  accessKeyId: 'your access key',\n  accessKeySecret: 'your access secret',\n  bucket: 'your bucket name',\n  endpoint: 'oss-accelerate.aliyuncs.com'\n});\n```\n\n3. use custom domain\n\n```js\nconst OSS = require('ali-oss');\n\nconst store = new OSS({\n  accessKeyId: 'your access key',\n  accessKeySecret: 'your access secret',\n  cname: true,\n  endpoint: 'your custome domain'\n});\n```\n\n4. use STS and refreshSTSToken\n\n```js\nconst OSS = require('ali-oss');\n\nconst store = new OSS({\n  accessKeyId: 'your STS key',\n  accessKeySecret: 'your STS secret',\n  stsToken: 'your STS token',\n  refreshSTSToken: async () => {\n    const info = await fetch('you sts server');\n    return {\n      accessKeyId: info.accessKeyId,\n      accessKeySecret: info.accessKeySecret,\n      stsToken: info.stsToken\n    };\n  },\n  refreshSTSTokenInterval: 300000\n});\n```\n\n5. retry request with stream\n\n```js\nfor (let i = 0; i <= store.options.retryMax; i++) {\n  try {\n    const result = await store.putStream('<example-object>', fs.createReadStream('<example-path>'));\n    console.log(result);\n    break; // break if success\n  } catch (e) {\n    console.log(e);\n  }\n}\n```\n\n6. use V4 signature, and use optional additionalHeaders option which type is a string array, and the values inside need to be included in the header.\n\n```js\nconst OSS = require('ali-oss');\n\nconst store = new OSS({\n  accessKeyId: 'your access key',\n  accessKeySecret: 'your access secret',\n  bucket: 'your bucket name',\n  region: 'oss-cn-hangzhou',\n  authorizationV4: true\n});\n\ntry {\n  const bucketInfo = await store.getBucketInfo('your bucket name');\n  console.log(bucketInfo);\n} catch (e) {\n  console.log(e);\n}\n\ntry {\n  const putObjectResult = await store.put('your bucket name', 'your object name', {\n    headers: {\n      // The headers of this request\n      header1: 'value1',\n      header2: 'value2'\n    },\n    // The keys of the request headers that need to be calculated into the V4 signature. Please ensure that these additional headers are included in the request headers.\n    additionalHeaders: ['additional header1', 'additional header2']\n  });\n  console.log(putObjectResult);\n} catch (e) {\n  console.log(e);\n}\n```\n\n## Bucket Operations\n\n### .listBuckets(query[, options])\n\nList buckets in this account.\n\nparameters:\n\n- [query] {Object} query parameters, default is `null`\n  - [prefix] {String} search buckets using `prefix` key\n  - [marker] {String} search start from `marker`, including `marker` key\n  - [max-keys] {String|Number} max buckets, default is `100`, limit to `1000`\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return buckets list on `buckets` properties.\n\n- buckets {Array<BucketMeta>} bucket meta info list\n  Each `BucketMeta` will contains blow properties:\n  - name {String} bucket name\n  - region {String} bucket store data region, e.g.: `oss-cn-hangzhou-a`\n  - creationDate {String} bucket create GMT date, e.g.: `2015-02-19T08:39:44.000Z`\n  - storageClass {String} e.g.: `Standard`, `IA`, `Archive`\n- owner {Object} object owner, including `id` and `displayName`\n- isTruncated {Boolean} truncate or not\n- nextMarker {String} next marker string\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n- List top 10 buckets\n\n```js\nstore\n  .listBuckets({\n    'max-keys': 10\n  })\n  .then(result => {\n    console.log(result);\n  });\n```\n\n### .putBucket(name[, options])\n\nCreate a new bucket.\n\nparameters:\n\n- name {String} bucket name\n  If bucket exists and not belong to current account, will throw BucketAlreadyExistsError.\n  If bucket not exists, will create a new bucket and set it's ACL.\n- [options] {Object} optional parameters\n  - [acl] {String} include `private`,`public-read`,`public-read-write`\n  - [storageClass] {String} the storage type include (Standard,IA,Archive)\n  - [dataRedundancyType] {String} default `LRS`, include `LRS`,`ZRS`\n  - [timeout] {Number} the operation timeout\n\nSuccess will return the bucket name on `bucket` properties.\n\n- bucket {String} bucket name\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n- Create a bucket name `helloworld` location on HongKong\n\n```js\nstore.putBucket('helloworld').then(result => {\n  // use it by default\n  store.useBucket('helloworld');\n});\n```\n\n- Create a bucket name `helloworld` location on HongKong StorageClass `Archive`\n\n```js\nawait store.putBucket('helloworld', { StorageClass: 'Archive' });\n// use it by default\nstore.useBucket('helloworld');\n```\n\n### .deleteBucket(name[, options])\n\nDelete an empty bucket.\n\nparameters:\n\n- name {String} bucket name\n  If bucket is not empty, will throw BucketNotEmptyError.\n  If bucket is not exists, will throw NoSuchBucketError.\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n- Delete the exists 'helloworld' bucket on 'oss-cn-hongkong'\n\n```js\nstore.deleteBucket('helloworld').then(result => {});\n```\n\n### .useBucket(name)\n\nUse the bucket.\n\nparameters:\n\n- name {String} bucket name\n\nexample:\n\n- Use `helloworld` as the default bucket\n\n```js\nstore.useBucket('helloworld');\n```\n\n### .getBucketInfo(name)\n\nGet bucket information,include CreationDate、ExtranetEndpoint、IntranetEndpoint、Location、Name、StorageClass、\nOwner、AccessControlList、Versioning\n\nparameters:\n\n- name {String} bucket name\n\nexample:\n\n- Use `helloworld` as the default bucket\n\n```js\nstore.getBucketInfo('helloworld').then(res => {\n  console.log(res.bucket);\n});\n```\n\n### .getBucketStat(name)\n\nCall the GetBucketStat interface to get the storage capacity of the specified storage space (Bucket) and the number of files (Object).\n\nCalling this interface requires the oss:GetBucketStat permission.\nThe data obtained by calling this interface is not real-time data and may be delayed for more than an hour.\nThe point in time of the stored information obtained by calling this interface is not guaranteed to be up-to-date, i.e. the LastModifiedTime field returned by a later call to this interface may be smaller than the LastModifiedTime field returned by a previous call to this interface.\n\nparameters:\n\n- name {String} bucket name\n\nSuccess will return:\n\n- stat {Object} container for the BucketStat structure:\n\n  - Storage {String} the total storage capacity of the Bucket, in bytes.\n  - ObjectCount {String} total number of Objects in the Bucket。\n  - MultipartUploadCount {String} the number of Multipart Uploads in the Bucket that have been initialized but not yet completed (Complete) or not yet aborted (Abort).\n  - LiveChannelCount {String} the number of Live Channels in the Bucket.\n  - LastModifiedTime {String} the point in time, in timestamps, when the storage information was retrieved.\n  - StandardStorage {String} the amount of storage of the standard storage type, in bytes.\n  - StandardObjectCount {String} the number of objects of the standard storage type.\n  - InfrequentAccessStorage {String} the amount of billed storage for the low-frequency storage type, in bytes.\n  - InfrequentAccessRealStorage {String} the actual storage amount of the low-frequency storage type, in bytes.\n  - InfrequentAccessObjectCount {String} the number of Objects of the low-frequency storage type.\n  - ArchiveStorage {String} the amount of billed storage for the archive storage type, in bytes.\n  - ArchiveRealStorage {String} the actual storage amount of the archive storage type, in bytes.\n  - ArchiveObjectCount {String} the number of objects of the archive storage type.\n  - ColdArchiveStorage {String} the amount of billed storage for the cold archive storage type, in bytes.\n  - ColdArchiveRealStorage {String} the actual storage amount in bytes for the cold archive storage type.\n  - ColdArchiveObjectCount {String} the number of objects of the cold archive storage type.\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n- If you don't fill in the name, the default is the bucket defined during initialization.\n\n```js\nstore.getBucketStat().then(res => console.log(res));\n```\n\n### .getBucketLocation(name)\n\nGet bucket location\n\nparameters:\n\n- name {String} bucket name\n\nexample:\n\n- Use `helloworld` as the default bucket\n\n```js\nstore.getBucketLocation('helloworld').then(res => {\n  console.log(res.location);\n});\n```\n\n---\n\n### .putBucketACL(name, acl[, options])\n\nUpdate the bucket ACL.\n\nparameters:\n\n- name {String} bucket name\n- acl {String} access control list, current available: `public-read-write`, `public-read` and `private`\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n- Set bucket `helloworld` to `public-read-write`\n\n```js\nstore.putBucketACL('helloworld', 'public-read-write').then(result => {});\n```\n\n### .getBucketACL(name[, options])\n\nGet the bucket ACL.\n\nparameters:\n\n- name {String} bucket name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- acl {String} acl settiongs string\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n- Get bucket `helloworld`\n\n```js\nstore.getBucketACL('helloworld').then(result => {\n  console.log(result.acl);\n});\n```\n\n---\n\n### .putBucketLogging(name, prefix[, options])\n\nUpdate the bucket logging settings.\nLog file will create every one hour and name format: `<prefix><bucket>-YYYY-mm-DD-HH-MM-SS-UniqueString`.\n\nparameters:\n\n- name {String} bucket name\n- [prefix] {String} prefix path name to store the log files\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n- Enable bucket `helloworld` logging and save with prefix `logs/`\n\n```js\nstore.putBucketLogging('helloworld', 'logs/').then(result => {});\n```\n\n### .getBucketLogging(name[, options])\n\nGet the bucket logging settings.\n\nparameters:\n\n- name {String} bucket name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- enable {Boolean} enable logging or not\n- prefix {String} prefix path name to store the log files, maybe `null`\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n- Get bucket `helloworld` logging settings\n\n```js\nstore.getBucketLogging('helloworld').then(result => {\n  console.log(result.enable, result.prefix);\n});\n```\n\n### .deleteBucketLogging(name[, options])\n\nDelete the bucket logging settings.\n\nparameters:\n\n- name {String} bucket name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\n---\n\n### .putBucketWebsite(name, config[, options])\n\nSet the bucket as a static website.\n\nparameters:\n\n- name {String} bucket name\n- config {Object} website config, contains blow properties:\n  - index {String} default page, e.g.: `index.html`\n  - [error] {String} error page, e.g.: 'error.html'\n  - [supportSubDir] {String} default vaule false\n  - [type] {String} default value 0\n  - [routingRules] {Array} RoutingRules\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n```js\nstore\n  .putBucketWebsite('hello', {\n    index: 'index.html'\n  })\n  .then(result => {});\n```\n\n### .getBucketWebsite(name[, options])\n\nGet the bucket website config.\n\nparameters:\n\n- name {String} bucket name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- index {String} index page\n- error {String} error page, maybe `null`\n- supportSubDir {String}\n- type {String}\n- routingRules {Array}\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\n### .deleteBucketWebsite(name[, options])\n\nDelete the bucket website config.\n\nparameters:\n\n- name {String} bucket name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\n---\n\n### .putBucketReferer(name, allowEmpty, referers[, options])\n\nSet the bucket request `Referer` white list.\n\nparameters:\n\n- name {String} bucket name\n- allowEmpty {Boolean} allow empty request referer or not\n- referers {Array<String>} `Referer` white list, e.g.:\n  ```js\n  ['https://npm.taobao.org', 'http://cnpmjs.org'];\n  ```\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n```js\nstore.putBucketReferer('hello', false, ['https://npm.taobao.org', 'http://cnpmjs.org']).then(result => {});\n```\n\n### .getBucketReferer(name[, options])\n\nGet the bucket request `Referer` white list.\n\nparameters:\n\n- name {String} bucket name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- allowEmpty {Boolean} allow empty request referer or not\n- referers {Array<String>} `Referer` white list\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\n### .deleteBucketReferer(name[, options])\n\nDelete the bucket request `Referer` white list.\n\nparameters:\n\n- name {String} bucket name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\n---\n\n### .putBucketLifecycle(name, rules[, options])\n\nSet the bucket object lifecycle.\n\nparameters:\n\n- name {String} bucket name\n- rules {Array<Rule>} rule config list, each `Rule` will contains blow properties:\n  - [id] {String} rule id, if not set, OSS will auto create it with random string.\n  - prefix {String} store prefix\n  - status {String} rule status, allow values: `Enabled` or `Disabled`\n  - [expiration] {Object} specifies the expiration attribute of the lifecycle rules for the object.\n    - [days] {Number|String} expire after the `days`\n    - [createdBeforeDate] {String} expire date, e.g.: `2022-10-11T00:00:00.000Z`\n    - [expiredObjectDeleteMarker] {String} value `true`\n      `createdBeforeDate` and `days` and `expiredObjectDeleteMarker` must have one.\n  - [abortMultipartUpload] {Object} Specifies the expiration attribute of the multipart upload tasks that are not complete.\n    - [days] {Number|String} expire after the `days`\n    - [createdBeforeDate] {String} expire date, e.g.: `2022-10-11T00:00:00.000Z`\n      `createdBeforeDate` and `days` must have one.\n  - [transition] {Object} Specifies the time when an object is converted to the IA or archive storage class during a valid life cycle.\n    - storageClass {String} Specifies the storage class that objects that conform to the rule are converted into. allow values: `IA` or `Archive` or `ColdArchive` or `DeepColdArchive`\n    - [days] {Number|String} expire after the `days`\n    - [createdBeforeDate] {String} expire date, e.g.: `2022-10-11T00:00:00.000Z`\n      `createdBeforeDate` and `days` must have one.\n  - [noncurrentVersionTransition] {Object} Specifies the time when an object is converted to the IA or archive storage class during a valid life cycle.\n    - storageClass {String} Specifies the storage class that history objects that conform to the rule are converted into. allow values: `IA` or `Archive` or `ColdArchive` or `DeepColdArchive`\n    - noncurrentDays {String} expire after the `noncurrentDays`\n      `expiration`、 `abortMultipartUpload`、 `transition`、 `noncurrentVersionTransition` must have one.\n  - [noncurrentVersionExpiration] {Object} specifies the expiration attribute of the lifecycle rules for the history object.\n    - noncurrentDays {String} expire after the `noncurrentDays`\n  - [tag] {Object} Specifies the object tag applicable to a rule. Multiple tags are supported.\n    - key {String} Indicates the tag key.\n    - value {String} Indicates the tag value.\n      `tag` cannot be used with `abortMultipartUpload`\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n```js\nstore\n  .putBucketLifecycle('hello', [\n    {\n      id: 'delete after one day',\n      prefix: 'logs/',\n      status: 'Enabled',\n      days: 1\n    },\n    {\n      prefix: 'logs2/',\n      status: 'Disabled',\n      date: '2022-10-11T00:00:00.000Z'\n    }\n  ])\n  .then(result => {});\n```\n\nexample: for history with noncurrentVersionExpiration\n\n```js\nconst result = await store.putBucketLifecycle(bucket, [\n  {\n    id: 'expiration1',\n    prefix: 'logs/',\n    status: 'Enabled',\n    expiration: {\n      days: '1'\n    },\n    noncurrentVersionExpiration: {\n      noncurrentDays: '1'\n    }\n  }\n]);\nconsole.log(result);\n```\n\nexample: for history with expiredObjectDeleteMarker\n\n```js\nconst result = await store.putBucketLifecycle(bucket, [\n  {\n    id: 'expiration1',\n    prefix: 'logs/',\n    status: 'Enabled',\n    expiration: {\n      expiredObjectDeleteMarker: 'true'\n    },\n    noncurrentVersionExpiration: {\n      noncurrentDays: '1'\n    }\n  }\n]);\nconsole.log(result);\n```\n\nexample: for history with noncurrentVersionTransition\n\n```js\nconst result = await store.putBucketLifecycle(bucket, [\n  {\n    id: 'expiration1',\n    prefix: 'logs/',\n    status: 'Enabled',\n    noncurrentVersionTransition: {\n      noncurrentDays: '10',\n      storageClass: 'IA'\n    }\n  }\n]);\nconsole.log(result);\n```\n\n### .getBucketLifecycle(name[, options])\n\nGet the bucket object lifecycle.\n\nparameters:\n\n- name {String} bucket name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- rules {Array<Rule>} the lifecycle rule list\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\n### .deleteBucketLifecycle(name[, options])\n\nDelete the bucket object lifecycle.\n\nparameters:\n\n- name {String} bucket name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\n---\n\n### .putBucketCORS(name, rules[, options])\n\nSet CORS rules of the bucket object\n\nparameters:\n\n- name {String} bucket name\n- rules {Array<Rule>} rule config list, each `Rule` will contains below properties:\n  - allowedOrigin {String/Array} configure for Access-Control-Allow-Origin header\n  - allowedMethod {String/Array} configure for Access-Control-Allow-Methods header\n  - [allowedHeader] {String/Array} configure for Access-Control-Allow-Headers header\n  - [exposeHeader] {String/Array} configure for Access-Control-Expose-Headers header\n  - [maxAgeSeconds] {String} configure for Access-Control-Max-Age header\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n```js\nstore\n  .putBucketCORS('hello', [\n    {\n      allowedOrigin: '*',\n      allowedMethod: ['GET', 'HEAD']\n    }\n  ])\n  .then(result => {});\n```\n\n### .getBucketCORS(name[, options])\n\nGet CORS rules of the bucket object.\n\nparameters:\n\n- name {String} bucket name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- rules {Array<Rule>} the CORS rule list\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\n### .deleteBucketCORS(name[, options])\n\nDelete CORS rules of the bucket object.\n\nparameters:\n\n- name {String} bucket name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return:\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\n### .getBucketRequestPayment(bucketName[, options])\n\nget RequestPayment value of the bucket object.\n\nparameters:\n\n- bucketName {String} bucket name\n- [options] {Object} optional parameters\n\nSuccess will return:\n\n- status {Number} response status\n- payer {String} payer, BucketOwner or Requester\n- res {Object} response info, including\n  - data {Buffer} xml\n\n---\n\n### .putBucketRequestPayment(bucketName, payer[, options])\n\nput RequestPayment value of the bucket object.\n\nparameters:\n\n- bucketName {String}\n- payer {String} payer\n- [options] {Object} optional parameters\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\n---\n\n### .putBucketEncryption(name, rules)\n\nput BucketEncryption value of the bucket object.\n\nparameters:\n\n- name {String} bucket name\n- [rules] {Object} parameters\n  - SSEAlgorithm {String} encryption type, expect AES256 or KMS\n  - {KMSMasterKeyID} {String} needed when encryption type is KMS\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\n---\n\n### .getBucketEncryption(name)\n\nget BucketEncryption rule value of the bucket object.\n\nparameters:\n\n- name {String} bucket name\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n- encryption {Object} rules\n  - SSEAlgorithm {String} encryption type, AES256 or KMS\n  - {KMSMasterKeyID} {String} will be return when encryption type is KMS\n\n---\n\n### .deleteBucketEncryption(name)\n\ndelete BucketEncryption rule value of the bucket object.\n\nparameters:\n\n- name {String} bucket name\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\n---\n\n### .putBucketTags(name, tag[, options])\n\nAdds tags for a bucket or modify the tags for a bucket.\n\nparameters:\n\n- name {String} the object name\n- tag {Object} tag, eg. `{var1: value1,var2:value2}`\n- [options] {Object} optional args\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\n---\n\n### .getBucketTags(name[, options])\n\nObtains the tags for a bucket.\n\nparameters:\n\n- name {String} the object name\n- [options] {Object} optional args\n\nSuccess will return:\n\n- tag {Object} the tag of object\n- res {Object} response info\n\n---\n\n### .deleteBucketTags(name[, options])\n\nDeletes the tags added for a bucket.\n\nparameters:\n\n- name {String} the object name\n- [options] {Object} optional args\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\n---\n\n### .putBucketPolicy(name, policy[, options])\n\nAdds or modify policy for a bucket.\n\nparameters:\n\n- name {String} the bucket name\n- policy {Object} bucket policy\n- [options] {Object} optional args\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\nexample:\n\n```js\nconst policy = {\n  Version: '1',\n  Statement: [\n    {\n      Action: ['oss:PutObject', 'oss:GetObject'],\n      Effect: 'Deny',\n      Principal: ['1234567890'],\n      Resource: ['acs:oss:*:1234567890:*/*']\n    }\n  ]\n};\nconst result = await store.putBucketPolicy(bucket, policy);\nconsole.log(result);\n```\n\n---\n\n### .getBucketPolicy(name[, options])\n\nObtains the policy for a bucket.\n\nparameters:\n\n- name {String} the bucket name\n- [options] {Object} optional args\n\nSuccess will return:\n\n- policy {Object} the policy of bucket, if not exist, the value is null\n- res {Object} response info\n- status {Number} response status\n\n---\n\n### .deleteBucketPolicy(name[, options])\n\nDeletes the policy added for a bucket.\n\nparameters:\n\n- name {String} the bucket name\n- [options] {Object} optional args\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\n---\n\n### .getBucketVersioning(name[, options])\n\nObtains the version status of an object\n\nparameters:\n\n- name {String} the bucket name\n- [options] {Object} optional args\n\nSuccess will return:\n\n- status {Number} response status\n- versionStatus {String | undefined} version status, `Suspended` or `Enabled`. default value: `undefined`\n- res {Object} response info\n\n---\n\n### .putBucketVersioning(name, status[, options])\n\nset the version status of an object\n\nparameters:\n\n- name {String} the bucket name\n- status {String} version status, allow values: `Enabled` or `Suspended`\n- [options] {Object} optional args\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\n---\n\n### .getBucketInventory(name, inventoryId[, options])\n\nget bucket inventory by inventory-id\n\nparameters:\n\n- name {String} the bucket name\n- inventoryId {String} inventory-id\n- [options] {Object} optional args\n\nSuccess will return:\n\n- inventory {Inventory}\n- status {Number} response status\n- res {Object} response info\n\n```js\nasync function getBucketInventoryById() {\n  try {\n    const result = await store.getBucketInventory('bucket', 'inventoryid');\n    console.log(result.inventory);\n  } catch (err) {\n    console.log(err);\n  }\n}\n\ngetBucketInventoryById();\n```\n\n### putBucketInventory(name, inventory[, options])\n\nset bucket inventory\n\nparameters:\n\n- name {String} the bucket name\n- inventory {Inventory} inventory config\n- [options] {Object} optional args\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\n```ts\ntype Field =\n  'Size | LastModifiedDate | ETag | StorageClass | IsMultipartUploaded | EncryptionStatus | ObjectAcl | TaggingCount | ObjectType | Crc64';\ninterface Inventory {\n  id: string;\n  isEnabled: true | false;\n  prefix?: string;\n  OSSBucketDestination: {\n    format: 'CSV';\n    accountId: string;\n    rolename: string;\n    bucket: string;\n    prefix?: string;\n    encryption?:\n      | { 'SSE-OSS': '' }\n      | {\n          'SSE-KMS': {\n            keyId: string;\n          };\n        };\n  };\n  frequency: 'Daily' | 'Weekly';\n  includedObjectVersions: 'Current' | 'All';\n  optionalFields?: {\n    field?: Field[];\n  };\n}\n```\n\n```js\nconst inventory = {\n  id: 'default',\n  isEnabled: false, // `true` | `false`\n  prefix: 'ttt', // filter prefix\n  OSSBucketDestination: {\n    format: 'CSV',\n    accountId: '1817184078010220',\n    rolename: 'AliyunOSSRole',\n    bucket: 'your bucket',\n    prefix: 'test'\n    //encryption: {'SSE-OSS': ''},\n    /*\n      encryption: {\n      'SSE-KMS': {\n        keyId: 'test-kms-id';\n      };,\n    */\n  },\n  frequency: 'Daily', // `WEEKLY` | `Daily`\n  includedObjectVersions: 'All', // `All` | `Current`\n  optionalFields: {\n    field: [\n      'Size',\n      'LastModifiedDate',\n      'ETag',\n      'StorageClass',\n      'IsMultipartUploaded',\n      'EncryptionStatus',\n      'ObjectAcl',\n      'TaggingCount',\n      'ObjectType',\n      'Crc64'\n    ]\n  }\n};\n\nasync function putInventory() {\n  const bucket = 'Your Bucket Name';\n  try {\n    await store.putBucketInventory(bucket, inventory);\n  } catch (err) {\n    console.log(err);\n  }\n}\n\nputInventory();\n```\n\n### deleteBucketInventory(name, inventoryId[, options])\n\ndelete bucket inventory by inventory-id\n\nparameters:\n\n- name {String} the bucket name\n- inventoryId {String} inventory-id\n- [options] {Object} optional args\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\n### listBucketInventory(name[, options])\n\nlist bucket inventory\n\nparameters:\n\n- name {String} the bucket name\n- [options] {Object} optional args\n  - continuationToken used by search next page\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\nexample:\n\n```js\nasync function listBucketInventory() {\n  const bucket = 'Your Bucket Name';\n  let nextContinuationToken;\n  // list all inventory of the bucket\n  do {\n    const result = await store.listBucketInventory(bucket, nextContinuationToken);\n    console.log(result.inventoryList);\n    nextContinuationToken = result.nextContinuationToken;\n  } while (nextContinuationToken);\n}\n\nlistBucketInventory();\n```\n\n### .abortBucketWorm(name[, options])\n\nused to delete an unlocked retention policy.\n\nparameters:\n\n- name {String} the bucket name\n- [options] {Object} optional args\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\n---\n\n### .completeBucketWorm(name, wormId[, options])\n\nused to lock a retention policy.\n\nparameters:\n\n- name {String} the bucket name\n- wormId {String} worm id\n- [options] {Object} optional args\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\n---\n\n### .extendBucketWorm(name, wormId, days[, options])\n\nused to extend the retention period of objects in a bucket whose retention policy is locked.\n\nparameters:\n\n- name {String} the bucket name\n- wormId {String} worm id\n- days {String | Number} retention days\n- [options] {Object} optional args\n\nSuccess will return:\n\n- status {Number} response status\n- res {Object} response info\n\n---\n\n### .getBucketWorm(name[, options])\n\nused to query the retention policy information of the specified bucket.\n\nparameters:\n\n- name {String} the bucket name\n- [options] {Object} optional args\n\nSuccess will return:\n\n- wormId {String} worm id\n- state {String} `Locked` or `InProgress`\n- days {String} retention days\n- creationDate {String}\n- status {Number} response status\n- res {Object} response info\n\n---\n\n### .initiateBucketWorm(name, days[, options])\n\ncreate a retention policy.\n\nparameters:\n\n- name {String} the bucket name\n- days {String | Number}} set retention days\n- [options] {Object} optional args\n\nSuccess will return:\n\n- wormId {String} worm id\n- status {Number} response status\n- res {Object} response info\n\n---\n\n## Object Operations\n\nAll operations function return Promise, except `signatureUrl`.\n\n### .put(name, file[, options])\n\nAdd an object to the bucket.\n\nparameters:\n\n- name {String} object name store on OSS\n- file {String|Buffer|ReadStream|File(only support Browser)|Blob(only support Browser)} object local path, content buffer or ReadStream content instance use in Node, Blob and html5 File\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout (ms)\n  - [mime] {String} custom mime, will send with `Content-Type` entity header\n  - [meta] {Object} user meta, will send with `x-oss-meta-` prefix string\n    e.g.: `{ uid: 123, pid: 110 }`\n  - [callback] {Object} The callback parameter is composed of a JSON string encoded in Base64,detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm)<br>\n    - url {String} After a file is uploaded successfully, the OSS sends a callback request to this URL.\n    - [host] {String} The host header value for initiating callback requests.\n    - body {String} The value of the request body when a callback is initiated, for example, `key=${key}&etag=${etag}&my_var=${x:my_var}`.\n    - [contentType] {String} The Content-Type of the callback requests initiatiated, It supports application/x-www-form-urlencoded and application/json, and the former is the default value.\n    - [callbackSNI] {Boolean} Specifies whether OSS sends Server Name Indication (SNI) to the origin address specified by callbackUrl when a callback request is initiated from the client.\n    - [customValue] {Object} Custom parameters are a map of key-values<br>\n      e.g.:\n      ```js\n      var customValue = { var1: 'value1', var2: 'value2' };\n      ```\n  - [headers] {Object} extra headers\n    - 'Cache-Control' cache control for download, e.g.: `Cache-Control: public, no-cache`\n    - 'Content-Disposition' object name for download, e.g.: `Content-Disposition: somename`\n    - 'Content-Encoding' object content encoding for download, e.g.: `Content-Encoding: gzip`\n    - 'Expires' expires time for download, an absolute date and time. e.g.: `Tue, 08 Dec 2020 13:49:43 GMT`\n    - See more: [PutObject](https://help.aliyun.com/document_detail/31978.html#title-yxe-96d-x61)\n  - [disabledMD5] {Boolean} default true, it just work in Browser. if false,it means that MD5 is automatically calculated for uploaded files. **_NOTE:_** Synchronous computing tasks will block the main process\n\nSuccess will return the object information.\n\nobject:\n\n- name {String} object name\n- data {Object} callback server response data, sdk use JSON.parse() return\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n- Add an object through local file path\n\n```js\nconst filepath = '/home/ossdemo/demo.txt';\nstore.put('ossdemo/demo.txt', filepath).then((result) => {\n  console.log(result);\n});\n\n// {\n//   name: 'ossdemo/demo.txt',\n//   res: {\n//     status: 200,\n//     headers: {\n//       date: 'Tue, 17 Feb 2015 13:28:17 GMT',\n//       'content-length': '0',\n//       connection: 'close',\n//       etag: '\"BF7A03DA01440845BC5D487B369BC168\"',\n//       server: 'AliyunOSS',\n//       'x-oss-request-id': '54E341F1707AA0275E829244'\n//     },\n//     size: 0,\n//     rt: 92\n//   }\n// }\n```\n\n- Add an object through content buffer\n\n```js\nstore.put('ossdemo/buffer', Buffer.from('foo content')).then((result) => {\n  console.log(result);\n});\n\n// {\n//   name: 'ossdemo/buffer',\n//   url: 'http://demo.oss-cn-hangzhou.aliyuncs.com/ossdemo/buffer',\n//   res: {\n//     status: 200,\n//     headers: {\n//       date: 'Tue, 17 Feb 2015 13:28:17 GMT',\n//       'content-length': '0',\n//       connection: 'close',\n//       etag: '\"xxx\"',\n//       server: 'AliyunOSS',\n//       'x-oss-request-id': '54E341F1707AA0275E829243'\n//     },\n//     size: 0,\n//     rt: 92\n//   }\n// }\n```\n\n- Add an object through readstream\n\n```js\nconst filepath = '/home/ossdemo/demo.txt';\nstore.put('ossdemo/readstream.txt', fs.createReadStream(filepath)).then((result) => {\n  console.log(result);\n});\n\n// {\n//   name: 'ossdemo/readstream.txt',\n//   url: 'http://demo.oss-cn-hangzhou.aliyuncs.com/ossdemo/readstream.txt',\n//   res: {\n//     status: 200,\n//     headers: {\n//       date: 'Tue, 17 Feb 2015 13:28:17 GMT',\n//       'content-length': '0',\n//       connection: 'close',\n//       etag: '\"BF7A03DA01440845BC5D487B369BC168\"',\n//       server: 'AliyunOSS',\n//       'x-oss-request-id': '54E341F1707AA0275E829242'\n//     },\n//     size: 0,\n//     rt: 92\n//   }\n// }\n```\n\n### .putStream(name, stream[, options])\n\nAdd a stream object to the bucket.\n\nparameters:\n\n- name {String} object name store on OSS\n- stream {ReadStream} object ReadStream content instance\n- [options] {Object} optional parameters\n  - [contentLength] {Number} the stream length, `chunked encoding` will be used if absent\n  - [timeout] {Number} the operation timeout\n  - [mime] {String} custom mime, will send with `Content-Type` entity header\n  - [meta] {Object} user meta, will send with `x-oss-meta-` prefix string\n    e.g.: `{ uid: 123, pid: 110 }`\n  - [callback] {Object} The callback parameter is composed of a JSON string encoded in Base64,detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm)<br>\n    - url {String} After a file is uploaded successfully, the OSS sends a callback request to this URL.\n    - [host] {String} The host header value for initiating callback requests.\n    - body {String} The value of the request body when a callback is initiated, for example, key=${key}&etag=${etag}&my_var=${x:my_var}.\n    - [contentType] {String} The Content-Type of the callback requests initiatiated, It supports application/x-www-form-urlencoded and application/json, and the former is the default value.\n    - [callbackSNI] {Boolean} Specifies whether OSS sends Server Name Indication (SNI) to the origin address specified by callbackUrl when a callback request is initiated from the client.\n    - [customValue] {Object} Custom parameters are a map of key-values<br>\n      e.g.:\n      ```js\n      var customValue = { var1: 'value1', var2: 'value2' };\n      ```\n  - [headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html)\n    - 'Cache-Control' cache control for download, e.g.: `Cache-Control: public, no-cache`\n    - 'Content-Disposition' object name for download, e.g.: `Content-Disposition: somename`\n    - 'Content-Encoding' object content encoding for download, e.g.: `Content-Encoding: gzip`\n    - 'Expires' expires time for download, an absolute date and time. e.g.: `Tue, 08 Dec 2020 13:49:43 GMT`\n\nSuccess will return the object information.\n\nobject:\n\n- name {String} object name\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n- Add an object through readstream\n\n```js\nconst filepath = '/home/ossdemo/demo.txt';\nstore.putStream('ossdemo/readstream.txt', fs.createReadStream(filepath)).then((result) => {\n  console.log(result);\n});\n\n// {\n//   name: 'ossdemo/readstream.txt',\n//   url: 'http://demo.oss-cn-hangzhou.aliyuncs.com/ossdemo/readstream.txt',\n//   res: {\n//     status: 200,\n//     headers: {\n//       date: 'Tue, 17 Feb 2015 13:28:17 GMT',\n//       'content-length': '0',\n//       connection: 'close',\n//       etag: '\"BF7A03DA01440845BC5D487B369BC168\"',\n//       server: 'AliyunOSS',\n//       'x-oss-request-id': '54E341F1707AA0275E829242'\n//     },\n//     size: 0,\n//     rt: 92\n//   }\n// }\n```\n\n### .append(name, file[, options])\n\nAppend an object to the bucket, it's almost same as put, but it can add content to existing object rather than override it.\n\nAll parameters are same as put except for options.position\n\n- name {String} object name store on OSS\n- file {String|Buffer|ReadStream} object local path, content buffer or ReadStream content instance\n- [options] {Object} optional parameters\n  - [position] {String} specify the position which is the content length of the latest object\n  - [timeout] {Number} the operation timeout\n  - [mime] {String} custom mime, will send with `Content-Type` entity header\n  - [meta] {Object} user meta, will send with `x-oss-meta-` prefix string\n    e.g.: `{ uid: 123, pid: 110 }`\n  - [headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html)\n    - 'Cache-Control' cache control for download, e.g.: `Cache-Control: public, no-cache`\n    - 'Content-Disposition' object name for download, e.g.: `Content-Disposition: somename`\n    - 'Content-Encoding' object content encoding for download, e.g.: `Content-Encoding: gzip`\n    - 'Expires' expires time for download, an absolute date and time. e.g.: `Tue, 08 Dec 2020 13:49:43 GMT`\n\nobject:\n\n- name {String} object name\n- url {String} the url of oss\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n- nextAppendPosition {String} the next position（The browser needs to set cross domain and expose the x-oss-next-append-position header）\n\nexample:\n\n```js\nlet object = await store.append('ossdemo/buffer', Buffer.from('foo'));\n\n// append content to the existing object\nobject = await store.append('ossdemo/buffer', Buffer.from('bar'), {\n  position: object.nextAppendPosition\n});\n```\n\n### .getObjectUrl(name[, baseUrl])\n\nGet the Object url.\nIf provide `baseUrl`, will use `baseUrl` instead the default `endpoint`.\n\ne.g.:\n\n```js\nconst cdnUrl = store.getObjectUrl('foo/bar.jpg', 'https://mycdn.domian.com');\n// cdnUrl should be `https://mycdn.domian.com/foo/bar.jpg`\n```\n\n### .generateObjectUrl(name[, baseUrl])\n\nGet the Object url.\nIf provide `baseUrl`, will use `baseUrl` instead the default `bucket and endpoint `.\nSuggest use generateObjectUrl instead of getObjectUrl.\n\ne.g.:\n\n```js\nconst url = store.generateObjectUrl('foo/bar.jpg');\n// cdnUrl should be `https://${bucketname}.${endpotint}foo/bar.jpg`\n\nconst cdnUrl = store.generateObjectUrl('foo/bar.jpg', 'https://mycdn.domian.com');\n// cdnUrl should be `https://mycdn.domian.com/foo/bar.jpg`\n```\n\n### .head(name[, options])\n\nHead an object and get the meta info.\n\nparameters:\n\n- name {String} object name store on OSS\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n  - [versionId] {String} the version id of history object\n  - [headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html)\n    - 'If-Modified-Since' object modified after this time will return 200 and object meta,\n      otherwise return 304 not modified\n    - 'If-Unmodified-Since' object modified before this time will return 200 and object meta,\n      otherwise throw PreconditionFailedError\n    - 'If-Match' object etag equal this will return 200 and object meta,\n      otherwise throw PreconditionFailedError\n    - 'If-None-Match' object etag not equal this will return 200 and object meta,\n      otherwise return 304 not modified\n\nSuccess will return the object's meta information.\n\nobject:\n\n- status {Number} response status, maybe 200 or 304\n- meta {Object} object user meta, if not set on `put()`, will return null.\n  If return status 304, meta will be null too\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n    - [x-oss-version-id] return in multiversion\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nexample:\n\n- Head an exists object and get user meta\n\n```js\nawait this.store.put('ossdemo/head-meta', Buffer.from('foo'), {\n  meta: {\n    uid: 1,\n    path: 'foo/demo.txt'\n  }\n});\nconst object = await this.store.head('ossdemo/head-meta');\nconsole.log(object);\n\n// {\n//   status: 200,\n//   meta: {\n//     uid: '1',\n//     path: 'foo/demo.txt'\n//   },\n//   res: { ... }\n// }\n```\n\n- Head a not exists object\n\n```js\nconst object = await this.store.head('ossdemo/head-meta');\n// will throw NoSuchKeyError\n```\n\n### .getObjectMeta(name[, options])\n\nGet an object meta info include ETag、Size、LastModified and so on, not return object content.\n\nparameters:\n\n- name {String} object name store on OSS\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n  - [versionId] {String} the version id of history object\n\nSuccess will return the object's meta information.\n\nobject:\n\n- status {Number} response status\n- res {Object} response info, including\n  - headers {Object} response headers\n\nexample:\n\n- Head an exists object and get object meta info\n\n```js\nawait this.store.put('ossdemo/object-meta', Buffer.from('foo'));\nconst object = await this.store.getObjectMeta('ossdemo/object-meta');\nconsole.log(object);\n\n// {\n//   status: 200,\n//   res: { ... }\n// }\n```\n\n### .get(name[, file, options])\n\nGet an object from the bucket.\n\nparameters:\n\n- name {String} object name store on OSS\n- [file] {String|WriteStream|Object} file path or WriteStream instance to store the content\n  If `file` is null or ignore this parameter, function will return info contains `content` property.\n  If `file` is Object, it will be treated as options.\n- [options] {Object} optional parameters\n  - [versionId] {String} the version id of history object\n  - [timeout] {Number} the operation timeout\n  - [process] {String} image process params, will send with `x-oss-process`\n    e.g.: `{process: 'image/resize,w_200'}`\n  - [responseCacheControl] {String} default `no-cache`, (only support Browser). response-cache-control, will response with HTTP Header `Cache-Control`\n  - [headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html)\n    - 'Range' get specifying range bytes content, e.g.: `Range: bytes=0-9`\n    - 'If-Modified-Since' object modified after this time will return 200 and object meta,\n      otherwise return 304 not modified\n    - 'If-Unmodified-Since' object modified before this time will return 200 and object meta,\n      otherwise throw PreconditionFailedError\n    - 'If-Match' object etag equal this will return 200 and object meta,\n      otherwise throw PreconditionFailedError\n    - 'If-None-Match' object etag not equal this will return 200 and object meta,\n      otherwise return 304 not modified\n\nSuccess will return the info contains response.\n\nobject:\n\n- [content] {Buffer} file content buffer if `file` parameter is null or ignore\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n\nIf object not exists, will throw NoSuchKeyError.\n\nexample:\n\n- Get an exists object and store it to the local file\n\n```js\nconst filepath = '/home/ossdemo/demo.txt';\nawait store.get('ossdemo/demo.txt', filepath);\n```\n\n\\_ Store object to a writestream\n\n```js\nawait store.get('ossdemo/demo.txt', somestream);\n```\n\n- Get an object content buffer\n\n```js\nconst result = await store.get('ossdemo/demo.txt');\nconsole.log(Buffer.isBuffer(result.content));\n```\n\n- Get a processed image and store it to the local file\n\n```js\nconst filepath = '/home/ossdemo/demo.png';\nawait store.get('ossdemo/demo.png', filepath, { process: 'image/resize,w_200' });\n```\n\n- Get a not exists object\n\n```js\nconst filepath = '/home/ossdemo/demo.txt';\nawait store.get('ossdemo/not-exists-demo.txt', filepath);\n// will throw NoSuchKeyError\n```\n\n- Get a historic version object\n\n```js\nconst filepath = '/home/ossdemo/demo.txt';\nconst versionId = 'versionId string';\naw","readmeFilename":"README.md"}