{"id":13593975,"url":"https://github.com/ali-sdk/ali-oss","last_synced_at":"2025-05-12T13:22:42.467Z","repository":{"id":15689293,"uuid":"18427025","full_name":"ali-sdk/ali-oss","owner":"ali-sdk","description":"Aliyun OSS(Object Storage Service) JavaScript SDK for the Browser and Node.js","archived":false,"fork":false,"pushed_at":"2025-05-08T07:35:23.000Z","size":18229,"stargazers_count":1982,"open_issues_count":128,"forks_count":580,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-05-08T08:34:51.528Z","etag":null,"topics":["alibabacloud","aliyun","aliyun-oss","javascript","oss","sdk"],"latest_commit_sha":null,"homepage":"https://www.alibabacloud.com/help/doc-detail/52834.htm","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ali-sdk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-04-04T04:04:08.000Z","updated_at":"2025-05-08T07:35:28.000Z","dependencies_parsed_at":"2023-01-13T18:32:47.832Z","dependency_job_id":"caee3ca8-8b97-4ee1-bb32-6300843b0c0a","html_url":"https://github.com/ali-sdk/ali-oss","commit_stats":{"total_commits":741,"total_committers":47,"mean_commits":15.76595744680851,"dds":0.8191632928475033,"last_synced_commit":"07ce713faeec066dfb7cf4bda45a5d0264a22f30"},"previous_names":["aliyun/oss-nodejs-sdk"],"tags_count":111,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ali-sdk%2Fali-oss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ali-sdk%2Fali-oss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ali-sdk%2Fali-oss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ali-sdk%2Fali-oss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ali-sdk","download_url":"https://codeload.github.com/ali-sdk/ali-oss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745272,"owners_count":21957337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alibabacloud","aliyun","aliyun-oss","javascript","oss","sdk"],"created_at":"2024-08-01T16:01:27.077Z","updated_at":"2025-05-12T13:22:42.447Z","avatar_url":"https://github.com/ali-sdk.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"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 [5.x 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 \u003e= 8.0.0 required. You can use 4.x in Node.js \u003c 8.\n\n### Browser\n\n- IE \u003e= 10 \u0026 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\nPlease log in to the official website and contact technical support.\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, strictObjectNameValidation])](#signatureurlname-options-strictobjectnamevalidation)\n  - [.asyncSignatureUrl(name[, options, strictObjectNameValidation])](#asyncsignatureurlname-options-strictobjectnamevalidation)\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  - [.signPostObjectPolicyV4(policy, date)](#signpostobjectpolicyv4policy-date)\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: \u003e= 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: '\u003coss region\u003e',\n  accessKeyId: '\u003cYour accessKeyId\u003e',\n  accessKeySecret: '\u003cYour accessKeySecret\u003e',\n  bucket: '\u003cYour bucket name\u003e'\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 \u003e= 10 \u0026 Edge\n- Major versions of Chrome/Firefox/Safari\n- Major versions of Android/iOS/WP\n  \u003e Note: Because some browsers do not support promises, you need to introduce promise compatible libraries.\u003cbr\u003e\n  \u003e 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 `\u003cscript\u003e` 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\u003c!-- Introducing online resources --\u003e\n\u003cscript src=\"http://gosspublic.alicdn.com/aliyun-oss-sdk-x.x.x.min.js\"\u003e\u003c/script\u003e\n\u003c!-- Introducing offline resources --\u003e\n\u003cscript src=\"./aliyun-oss-sdk-x.x.x.min.js\"\u003e\u003c/script\u003e\n\n\u003cscript type=\"text/javascript\"\u003e\n  const store = new OSS({\n    region: 'oss-cn-hangzhou',\n    accessKeyId: '\u003caccess-key-id\u003e',\n    accessKeySecret: '\u003caccess-key-secret\u003e',\n    bucket: '\u003cbucket-name\u003e',\n    stsToken: '\u003csecurity-token\u003e'\n  });\n\n  store\n    .list()\n    .then(result =\u003e {\n      console.log('objects: %j', result.objects);\n      return store.put('my-obj', new OSS.Buffer('hello world'));\n    })\n    .then(result =\u003e {\n      console.log('put result: %j', result);\n      return store.get('my-obj');\n    })\n    .then(result =\u003e {\n      console.log('get result: %j', result.content.toString());\n    });\n\u003c/script\u003e\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- [cloudBoxId] {String} the CloudBox ID you want to access. When configuring this option, please set the endpoint option to the CloudBox endpoint and set the authorizationV4 option to true.\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 () =\u003e {\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 \u003c= store.options.retryMax; i++) {\n  try {\n    const result = await store.putStream('\u003cexample-object\u003e', fs.createReadStream('\u003cexample-path\u003e'));\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\u003cBucketMeta\u003e} 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 =\u003e {\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 =\u003e {\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 =\u003e {});\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 =\u003e {\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 =\u003e 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 =\u003e {\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 =\u003e {});\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 =\u003e {\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: `\u003cprefix\u003e\u003cbucket\u003e-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 =\u003e {});\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 =\u003e {\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 =\u003e {});\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\u003cString\u003e} `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 =\u003e {});\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\u003cString\u003e} `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\u003cRule\u003e} 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 =\u003e {});\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\u003cRule\u003e} 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\u003cRule\u003e} 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 =\u003e {});\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\u003cRule\u003e} 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)\u003cbr\u003e\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}\u0026etag=${etag}\u0026my_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\u003cbr\u003e\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) =\u003e {\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) =\u003e {\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) =\u003e {\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)\u003cbr\u003e\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}\u0026etag=${etag}\u0026my_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\u003cbr\u003e\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) =\u003e {\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';\nawait store.get('ossdemo/not-exists-demo.txt', filepath, {\n  versionId\n});\n```\n\n- If `file` is Object, it will be treated as options.\n\n```js\nconst versionId = 'versionId string';\nawait store.get('ossdemo/not-exists-demo.txt', { versionId });\n```\n\n### .getStream(name[, options])\n\nGet an object read stream.\n\nparameters:\n\n- name {String} object name store on OSS\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n  - [process] {String} image process params, will send with `x-oss-process`\n  - [headers] {Object} extra headers\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 stream instance and response info.\n\nobject:\n\n- stream {ReadStream} readable stream instance. If response status is not `200`, stream will be `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\nIf object not exists, will throw NoSuchKeyError.\n\nexample:\n\n- Get an exists object stream\n\n```js\nconst result = await store.getStream('ossdemo/demo.txt');\nresult.stream.pipe(fs.createWriteStream('some file.txt'));\n```\n\n### .delete(name[, options])\n\nDelete an object from the bucket.\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 info contains response.\n\nobject:\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\nIf delete object not exists, will also delete success.\n\nexample:\n\n- Delete an exists object\n\n```js\nawait store.delete('ossdemo/someobject');\n```\n\n- Delete a not exists object\n\n```js\nawait store.delete('ossdemo/some-not-exists-object');\n```\n\n- Delete a history object or deleteMarker\n\n```js\nconst versionId = 'versionId';\nawait store.delete('ossdemo/some-not-exists-object', { versionId });\n```\n\n### .copy(name, sourceName[, sourceBucket, options])\n\nCopy an object from `sourceName` to `name`.\n\nparameters:\n\n- name {String} object name store on OSS\n- sourceName {String} source object name\n- [sourceBucket] {String} source Bucket. if doesn't exist，`sourceBucket` is same bucket.\n- [options] {Object} optional parameters\n  - [versionId] {String} the version id of history object\n  - [timeout] {Number} the operation timeout\n  - [meta] {Object} user meta, will send with `x-oss-meta-` prefix string\n    e.g.: `{ uid: 123, pid: 110 }`\n    If the `meta` set, will override the source object meta.\n  - [headers] {Object} extra headers\n    - 'If-Match' do copy if source object etag equal this,\n      otherwise throw PreconditionFailedError\n    - 'If-None-Match' do copy if source object etag not equal this,\n      otherwise throw PreconditionFailedError\n    - 'If-Modified-Since' do copy if source object modified after this time,\n      otherwise throw PreconditionFailedError\n    - 'If-Unmodified-Since' do copy if source object modified before this time,\n      otherwise throw PreconditionFailedError\n    - See more: [CopyObject](https://help.aliyun.com/document_detail/31979.html?#title-tzy-vxc-ncx)\n\nSuccess will return the copy result in `data` property.\n\nobject:\n\n- data {Object} copy result\n  - lastModified {String} object last modified GMT string\n  - etag {String} object etag contains `\"`, e.g.: `\"5B3C1A2E053D763E1B002CC607C5A0FE\"`\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 source object not exists, will throw NoSuchKeyError.\n\nexample:\n\n- Copy same bucket object\n\n```js\nstore.copy('newName', 'oldName').then(result =\u003e {\n  console.log(result);\n});\n```\n\n- Copy other bucket object\n\n```js\nstore.copy('logo.png', 'logo.png', 'other-bucket').then(result =\u003e {\n  console.log(result);\n});\n```\n\n- Copy historic object\n\n```js\nconst versionId = 'your verisonId';\nstore.copy('logo.png', 'logo.png', 'other-bucket', { versionId }).then(result =\u003e {\n  console.log(result);\n});\n```\n\n### .putMeta(name, meta[, options])\n\nSet an exists object meta.\n\nparameters:\n\n- name {String} object name store on OSS\n- meta {Object} user meta, will send with `x-oss-meta-` prefix string\n  e.g.: `{ uid: 123, pid: 110 }`\n  If `meta: null`, will clean up the exists meta\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return the putMeta result in `data` property.\n\n- data {Object} copy result\n  - lastModified {String} object last modified GMT date, e.g.: `2015-02-19T08:39:44.000Z`\n  - etag {String} object etag contains `\"`, e.g.: `\"5B3C1A2E053D763E1B002CC607C5A0FE\"`\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- Update exists object meta\n\n```js\nconst result = await store.putMeta('ossdemo.txt', {\n  uid: 1,\n  pid: 'p123'\n});\nconsole.log(result);\n```\n\n- Clean up object meta\n\n```js\nawait store.putMeta('ossdemo.txt', null);\n```\n\n### .deleteMulti(names[, options])\n\nDelete multi objects in one request.\n\nparameters:\n\n- names {Array\u003cObject\u003e} object names, max 1000 objects in once.\n  - key {String} object name\n  - [versionId] {String} the version id of history object or deleteMarker\n- [options] {Object} optional parameters\n  - [quiet] {Boolean} quiet mode or verbose mode, default is `false`, verbose mode\n    quiet mode: if all objects delete succes, return emtpy response.\n    otherwise return delete error object results.\n    verbose mode: return all object delete results.\n  - [timeout] {Number} the operation timeout\n\nSuccess will return delete success objects in `deleted` property.\n\n- [deleted] {Array\u003cObject\u003e} deleted object or deleteMarker info list\n  - [Key] {String} object name\n  - [VersionId] {String} object versionId\n  - [DeleteMarker] {String} generate or delete marker\n  - [DeleteMarkerVersionId] {String} marker versionId\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 multi objects in quiet mode\n\n```js\nconst result = await store.deleteMulti(['obj1', 'obj2', 'obj3'], {\n  quiet: true\n});\n```\n\n- Delete multi objects in verbose mode\n\n```js\nconst result = await store.deleteMulti(['obj1', 'obj2', 'obj3']);\n```\n\n- Delete multi objects in multiversion\n\n```js\nconst obj1 = {\n  key: 'key1',\n  versionId: 'versionId1'\n};\nconst obj2 = {\n  key: 'key2',\n  versionId: 'versionId2'\n};\nconst result = await store.deleteMulti([obj1, obj2]);\n```\n\n### .list(query[, options])\n\nList objects in the bucket.\n\nparameters:\n\n- [query] {Object} query parameters, default is `null`\n  - [prefix] {String} search object using `prefix` key\n  - [marker] {String} search start from `marker`, including `marker` key\n  - [delimiter] {String} delimiter search scope\n    e.g. `/` only search current dir, not including subdir\n  - [max-keys] {String|Number} max objects, default is `100`, limit to `1000`\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return objects list on `objects` properties.\n\n- objects {Array\u003cObjectMeta\u003e} object meta info list\n  Each `ObjectMeta` will contains blow properties:\n  - name {String} object name on oss\n  - lastModified {String} object last modified GMT date, e.g.: `2015-02-19T08:39:44.000Z`\n  - etag {String} object etag contains `\"`, e.g.: `\"5B3C1A2E053D763E1B002CC607C5A0FE\"`\n  - type {String} object type, e.g.: `Normal`\n  - size {Number} object size, e.g.: `344606`\n  - storageClass {String} storage class type, e.g.: `Standard`\n  - owner {Object} object owner, including `id` and `displayName`\n  - restoreInfo {Object|undefined} The restoration status of the object\n    - ongoingRequest {Boolean} Whether the restoration is ongoing\n    - expireDate {Date|undefined} The time before which the restored object can be read\n- prefixes {Array\u003cString\u003e} prefix list\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 objects\n\n```js\nconst result = await store.list();\nconsole.log(result.objects);\n```\n\n- List `fun/` dir including subdirs objects\n\n```js\nconst result = await store.list({\n  prefix: 'fun/'\n});\nconsole.log(result.objects);\n```\n\n- List `fun/` dir objects, not including subdirs\n\n```js\nconst result = await store.list({\n  prefix: 'fun/',\n  delimiter: '/'\n});\nconsole.log(result.objects);\n```\n\n### .listV2(query[, options])\n\nList objects in the bucket.(recommended)\n\nparameters:\n\n- [query] {Object} query parameters, default is `null`\n  - [prefix] {String} search object using `prefix` key\n  - [continuation-token] (continuationToken) {String} search start from `continuationToken`, including `continuationToken` key\n  - [delimiter] {String} delimiter search scope\n    e.g. `/` only search current dir, not including subdir\n  - [max-keys] {String|Number} max objects, default is `100`, limit to `1000`\n  - [start-after] {String} specifies the Start-after value from which to start the list. The names of objects are returned in alphabetical order.\n  - [fetch-owner] {Boolean} specifies whether to include the owner information in the response.\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return objects list on `objects` properties.\n\n- objects {Array\u003cObjectMeta\u003e} object meta info list\n  Each `ObjectMeta` will contains blow properties:\n  - name {String} object name on oss\n  - url {String} resource url\n  - lastModified {String} object last modified GMT date, e.g.: `2015-02-19T08:39:44.000Z`\n  - etag {String} object etag contains `\"`, e.g.: `\"5B3C1A2E053D763E1B002CC607C5A0FE\"`\n  - type {String} object type, e.g.: `Normal`\n  - size {Number} object size, e.g.: `344606`\n  - storageClass {String} storage class type, e.g.: `Standard`\n  - owner {Object|null} object owner, including `id` and `displayName`\n  - restoreInfo {Object|undefined} The restoration status of the object\n    - ongoingRequest {Boolean} Whether the restoration is ongoing\n    - expireDate {Date|undefined} The time before which the restored object can be read\n- prefixes {Array\u003cString\u003e} prefix list\n- isTruncated {Boolean} truncate or not\n- nextContinuationToken {String} next continuation-token string\n- keyCount {Number} The number of keys returned for this request. If Delimiter is specified, KeyCount is the sum of the elements in Key and CommonPrefixes.\n- res {Object} response info, including\n\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- List top 10 objects\n\n```js\nconst result = await store.listV2({\n  'max-keys': 10\n});\nconsole.log(result.objects);\n```\n\n- List `fun/` dir including subdirs objects\n\n```js\nconst result = await store.listV2({\n  prefix: 'fun/'\n});\nconsole.log(result.objects);\n```\n\n- List `fun/` dir objects, not including subdirs\n\n```js\nconst result = await store.listV2({\n  prefix: 'fun/',\n  delimiter: '/'\n});\nconsole.log(result.objects);\n```\n\n- List `a/` dir objects, after `a/b` and not include `a/b`\n\n```js\nconst result = await store.listV2({\n  delimiter: '/',\n  prefix: 'a/',\n  'start-after': 'a/b'\n});\nconsole.log(result.objects);\n```\n\n### .getBucketVersions(query[, options])\n\nList the version information of all objects in the bucket, including the delete marker (Delete Marker).\n\nparameters:\n\n- [query] {Object} query parameters, default is `null`\n  - [prefix] {String} search object using `prefix` key\n  - [versionIdMarker] {String} set the result to return from the version ID marker of the key marker object and sort by the versions\n  - [keyMarker] {String} search start from `keyMarker`, including `keyMarker` key\n  - [encodingType] {String} specifies that the returned content is encoded, and specifies the type of encoding\n  - [delimiter] {String} delimiter search scope\n    e.g. `/` only search current dir, not including subdir\n  - [maxKeys] {String|Number} max objects, default is `100`, limit to `1000`\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n\nSuccess will return objects list on `objects` properties.\n\n- objects {Array\u003cObjectMeta\u003e} object meta info list\n  Each `ObjectMeta` will contains blow properties:\n  - name {String} object name on oss\n  - lastModified {String} object last modified GMT date, e.g.: `2015-02-19T08:39:44.000Z`\n  - etag {String} object etag contains `\"`, e.g.: `\"5B3C1A2E053D763E1B002CC607C5A0FE\"`\n  - type {String} object type, e.g.: `Normal`\n  - size {Number} object size, e.g.: `344606`\n  - isLatest {Boolean}\n  - versionId {String} object versionId\n  - storageClass {String} storage class type, e.g.: `Standard`\n  - owner {Object} object owner, including `id` and `displayName`\n  - restoreInfo {Object|undefined} The restoration status of the object\n    - ongoingRequest {Boolean} Whether the restoration is ongoing\n    - expireDate {Date|undefined} The time before which the restored object can be read\n- deleteMarker {Array\u003cObjectDeleteMarker\u003e} object delete marker info list\n  Each `ObjectDeleteMarker`\n  - name {String} object name on oss\n  - lastModified {String} object last modified GMT date, e.g.: `2015-02-19T08:39:44.000Z`\n  - versionId {String} object versionId\n- isTruncated {Boolean} truncate or not\n- nextKeyMarker (nextMarker) {String} next marker string\n- nextVersionIdMarker (NextVersionIdMarker) {String} next version ID 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- View all versions of objects and deleteMarker of bucket\n\n```js\nconst result = await store.getBucketVersions();\nconsole.log(result.objects);\nconsole.log(result.deleteMarker);\n```\n\n- List from key-marker\n\n```js\nconst result = await store.getBucketVersions({\n  keyMarker: 'keyMarker'\n});\nconsole.log(result.objects);\n```\n\n- List from the version-id-marker of key-marker\n\n```js\nconst result = await store.getBucketVersions({\n  versionIdMarker: 'versionIdMarker',\n  keyMarker: 'keyMarker'\n});\nconsole.log(result.objects);\nconsole.log(result.deleteMarker);\n```\n\n### .signatureUrl(name[, options, strictObjectNameValidation])\n\nCreate a signature url for download or upload object. When you put object with signatureUrl ,you need to pass `Content-Type`.Please look at the example.\n\nparameters:\n\n- name {String} object name store on OSS\n- [options] {Object} optional parameters\n  - [expires] {Number} after expires seconds, the url will become invalid, default is `1800`\n  - [method] {String} the HTTP method, default is 'GET'\n  - [Content-Type] {String} set the request content type\n  - [process] {String} image process params, will send with `x-oss-process`\n    e.g.: `{process: 'image/resize,w_200'}`\n  - [trafficLimit] {Number} traffic limit, range: `819200`~`838860800`.\n  - [subResource] {Object} additional signature parameters in url.\n  - [response] {Object} set the response headers for download\n    - [content-type] {String} set the response content type\n    - [content-disposition] {String} set the response content disposition\n    - [cache-control] {String} set the response cache control\n    - See more: \u003chttps://help.aliyun.com/document_detail/31980.html\u003e\n  - [callback] {Object} set the callback for the operation\n    - url {String} set the url for callback\n    - [host] {String} set the host for callback\n    - body {String} set the body for callback\n    - [contentType] {String} set the type for body\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} set the custom value for callback,eg. {var1: value1,var2:value2}\n- [strictObjectNameValidation] {boolean} the flag of verifying object name strictly, default is true\n\nSuccess will return signature url.\n\nexample:\n\n- Get signature url for object\n\n```js\nconst url = store.signatureUrl('ossdemo.txt');\nconsole.log(url);\n// --------------------------------------------------\nconst url = store.signatureUrl('ossdemo.txt', {\n  expires: 3600,\n  method: 'PUT'\n});\nconsole.log(url);\n\n//  put object with signatureUrl\n// -------------------------------------------------\n\nconst url = store.signatureUrl('ossdemo.txt', {\n  expires: 3600,\n  method: 'PUT',\n  'Content-Type': 'text/plain; charset=UTF-8'\n});\nconsole.log(url);\n\n// --------------------------------------------------\nconst url = store.signatureUrl(\n  'ossdemo.txt',\n  {\n    expires: 3600,\n    response: {\n      'content-type': 'text/custom',\n      'content-disposition': 'attachment'\n    }\n  },\n  false\n);\nconsole.log(url);\n\n// put operation\n```\n\n- Get a signature url for a processed image\n\n```js\nconst url = store.signatureUrl('ossdemo.png', {\n  process: 'image/resize,w_200'\n});\nconsole.log(url);\n// --------------------------------------------------\nconst url = store.signatureUrl('ossdemo.png', {\n  expires: 3600,\n  process: 'image/resize,w_200'\n});\nconsole.log(url);\n```\n\n### .asyncSignatureUrl(name[, options, strictObjectNameValidation])\n\nBasically the same as signatureUrl, if refreshSTSToken is configured asyncSignatureUrl will refresh stsToken\n\nparameters:\n\n- name {String} object name store on OSS\n- [options] {Object} optional parameters\n  - [expires] {Number} after expires seconds, the url will become invalid, default is `1800`\n  - [method] {String} the HTTP method, default is 'GET'\n  - [Content-Type] {String} set the request content type\n  - [process] {String} image process params, will send with `x-oss-process`\n    e.g.: `{process: 'image/resize,w_200'}`\n  - [trafficLimit] {Number} traffic limit, range: `819200`~`838860800`.\n  - [subResource] {Object} additional signature parameters in url.\n  - [response] {Object} set the response headers for download\n    - [content-type] {String} set the response content type\n    - [content-disposition] {String} set the response content disposition\n    - [cache-control] {String} set the response cache control\n    - See more: \u003chttps://help.aliyun.com/document_detail/31980.html\u003e\n  - [callback] {Object} set the callback for the operation\n    - url {String} set the url for callback\n    - [host] {String} set the host for callback\n    - body {String} set the body for callback\n    - [contentType] {String} set the type for body\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} set the custom value for callback,eg. {var1: value1,var2:value2}\n- [strictObjectNameValidation] {boolean} the flag of verifying object name strictly, default is true\n\nSuccess will return signature url.\n\nexample:\n\n- Get signature url for object\n\n```js\nconst url = await store.asyncSignatureUrl('ossdemo.txt');\nconsole.log(url);\n// --------------------------------------------------\nconst url = await store.asyncSignatureUrl('ossdemo.txt', {\n  expires: 3600,\n  method: 'PUT'\n});\nconsole.log(url);\n//  put object with signatureUrl\n// -------------------------------------------------\nconst url = await store.asyncSignatureUrl('ossdemo.txt', {\n  expires: 3600,\n  method: 'PUT',\n  'Content-Type': 'text/plain; charset=UTF-8'\n});\nconsole.log(url);\n// --------------------------------------------------\nconst url = await store.asyncSignatureUrl(\n  'ossdemo.txt',\n  {\n    expires: 3600,\n    response: {\n      'content-type': 'text/custom',\n      'content-disposition': 'attachment'\n    }\n  },\n  false\n);\nconsole.log(url);\n// put operation\n```\n\n- Get a signature url for a processed image\n\n```js\nconst url = await store.asyncSignatureUrl('ossdemo.png', {\n  process: 'image/resize,w_200'\n});\nconsole.log(url);\n// --------------------------------------------------\nconst url = await store.asyncSignatureUrl('ossdemo.png', {\n  expires: 3600,\n  process: 'image/resize,w_200'\n});\nconsole.log(url);\n```\n\n### .signatureUrlV4(method, expires[, request, objectName, additionalHeaders])\n\nGenerate a signed URL for V4 of an OSS resource and share the URL to allow authorized third-party users to access the resource.\n\nparameters:\n\n- method {string} the HTTP method\n- expires {number} the signed URL will expire after the set number of seconds\n- [request] {Object} optional request parameters\n  - [headers] {Object} headers of http requests, please make sure these request headers are set during the actual request\n  - [queries] {Object} queries of the signed URL, please ensure that if the query only has key, the value is set to null\n- [objectName] {string} object name\n- [additionalHeaders] {string[]} 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\nSuccess will return signature url.\n\nexample:\n\n```js\n//  GetObject\nconst getObjectUrl = await store.signatureUrlV4('GET', 60, undefined, 'your obejct name');\nconsole.log(getObjectUrl);\n// --------------------------------------------------\nconst getObjectUrl = await store.signatureUrlV4(\n  'GET',\n  60,\n  {\n    headers: {\n      'Cache-Control': 'no-cache'\n    },\n    queries: {\n      versionId: 'version ID of your object'\n    }\n  },\n  'your obejct name',\n  ['Cache-Control']\n);\nconsole.log(getObjectUrl);\n\n// -------------------------------------------------\n//  PutObject\nconst putObejctUrl = await store.signatureUrlV4('PUT', 60, undefined, 'your obejct name');\nconsole.log(putObejctUrl);\n// --------------------------------------------------\nconst putObejctUrl = await store.signatureUrlV4(\n  'PUT',\n  60,\n  {\n    headers: {\n      'Content-Type': 'text/plain',\n      'Content-MD5': 'xxx',\n      'Content-Length': 1\n    }\n  },\n  'your obejct name',\n  ['Content-Length']\n);\nconsole.log(putObejctUrl);\n```\n\n### .putACL(name, acl[, options])\n\nSet object's ACL.\n\nparameters:\n\n- name {String} object name\n- acl {String} acl (private/public-read/public-read-write)\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n  - [versionId] {String} the version id of history object\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 an object's ACL\n\n```js\nawait store.putACL('ossdemo.txt', 'public-read');\n```\n\n- Set an history object's ACL\n\n```js\nconst versionId = 'object versionId';\nawait store.putACL('ossdemo.txt', 'public-read', {\n  versionId\n});\n```\n\n### .getACL(name[, options])\n\nGet object's ACL.\n\nparameters:\n\n- name {String} object name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n  - [versionId] {String} the version id of history object\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 an object's ACL\n\n```js\nconst result = await store.getACL('ossdemo.txt');\nconsole.log(result.acl);\n```\n\n- Get an history object's ACL\n\n```js\nconst versionId = 'object versionId';\nconst result = await store.getACL('ossdemo.txt', { versionId });\nconsole.log(result.acl);\n```\n\n### .restore(name[, options])\n\nRestore Object.\n\nparameters:\n\n- name {String} object name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n  - [versionId] {String} the version id of history object\n  - [type] {String} the default type is Archive\n  - [Days] {number} The duration within which the object remains in the restored state. The default value is 2.\n  - [JobParameters] {string} The container that stores the restoration priority. This parameter is valid only when you restore Cold Archive or Deep Cold Archive objects. The default value is Standard.\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- Restore an Archive object\n\n```js\nconst result = await store.restore('ossdemo.txt');\nconsole.log(result.status);\n```\n\n- Restore a Cold Archive object\n\n```js\nconst result = await store.restore('ossdemo.txt', { type: 'ColdArchive' });\nconsole.log(result.status);\n```\n\n- Restore a Cold Archive object with Days\n\n```js\nconst result = await store.restore('ossdemo.txt', { type: 'ColdArchive', Days: 2 });\nconsole.log(result.status);\n```\n\n- Restore a Cold Archive object with Days and JobParameters\n```js\nconst result = await store.restore('ossdemo.txt', { type: 'ColdArchive', Days: 2, JobParameters: 'Standard' });\nconsole.log(result.status);\n```\n\n- Restore a Deep Cold Archive object\n\n```js\nconst result = await store.restore('ossdemo.txt', { type: 'DeepColdArchive' });\nconsole.log(result.status);\n```\n\n- Restore a Deep Cold Archive object with Days\n\n```js\nconst result = await store.restore('ossdemo.txt', { type: 'DeepColdArchive', Days: 2 });\nconsole.log(result.status);\n```\n\n- Restore a Deep Cold Archive object with Days and JobParameters\n\n```js\nconst result = await store.restore('ossdemo.txt', { type: 'DeepColdArchive', Days: 2, JobParameters: 'Standard' });\nconsole.log(result.status);\n```\n\n- Restore an history object\n\n```js\nconst versionId = 'object versionId';\nconst result = await store.restore('ossdemo.txt', { versionId });\nconsole.log(result.status);\n```\n\n### .putSymlink(name, targetName[, options])\n\nPutSymlink\n\nparameters:\n\n- name {String} object name\n- targetName {String} target object name\n- [options] {Object} optional parameters\n\n  - [storageClass] {String} the storage type include (Standard,IA,Archive)\n  - [meta] {Object} user meta, will send with `x-oss-meta-` prefix string\n  - [headers] {Object} extra headers, detail see [PutSymlink](https://help.aliyun.com/document_detail/45126.html#title-x71-l2b-7i8)\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\nconst options = {\n  storageClass: 'IA',\n  meta: {\n    uid: '1',\n    slus: 'test.html'\n  }\n};\nconst result = await store.putSymlink('ossdemo.txt', 'targetName', options);\nconsole.log(result.res);\n```\n\nputSymlink multiversion\n\n```js\nconst options = {\n  storageClass: 'IA',\n  meta: {\n    uid: '1',\n    slus: 'test.html'\n  }\n};\nconst result = await store.putSymlink('ossdemo.txt', 'targetName', options);\nconsole.log(result.res.headers['x-oss-version-id']);\n```\n\n### .getSymlink(name[, options])\n\nGetSymlink\n\nparameters:\n\n- name {String} object name\n- [options] {Object} optional parameters\n- [versionId] {String} the version id of history object\n\nSuccess will return\n\n- targetName {String} target 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```js\nconst result = await store.getSymlink('ossdemo.txt');\nconsole.log(result.targetName);\n```\n\nfor history object\n\n```js\nconst versionId = 'object versionId';\nconst result = await store.getSymlink('ossdemo.txt', { versionId });\nconsole.log(result.targetName);\n```\n\n### .initMultipartUpload(name[, options])\n\nBefore transmitting data in the Multipart Upload mode,\nyou must call the Initiate Multipart Upload interface to notify the OSS to initiate a Multipart Upload event.\nThe Initiate Multipart Upload interface returns a globally unique Upload ID created by the OSS server to identify this Multipart Upload event.\n\nparameters:\n\n- name {String} object name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n  - [mime] Mime file type e.g.: application/octet-stream\n  - [meta] {Object} user meta, will send with `x-oss-meta-` prefix string\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    - [x-oss-server-side-encryption]\n      Specify the server-side encryption algorithm used to upload each part of this object,Type: string, Valid value: AES256 `x-oss-server-side-encryption: AES256`\u003cbr\u003e\n      if use in browser you should be set cors expose header x-oss-server-side-encryption\n    - See more: [InitiateMultipartUpload](https://help.aliyun.com/document_detail/31992.html?#title-wh0-a2h-rur)\n\nSuccess will return:\n\n- res {Object} response info, including\n  - status {Number} response status\n  - headers {Object} response headers\n    - [x-oss-server-side-encryption] if set request header x-oss-server-side-encryption, will return\n  - size {Number} response size\n  - rt {Number} request total use time (ms)\n- bucket {String} bucket name\n- name {String} object name store on OSS\n- uploadId {String} upload id, use for uploadPart, completeMultipart\n\nexample:\n\n```js\nconst result = await store.initMultipartUpload('object');\nconsole.log(result);\n```\n\n### .uploadPart(name, uploadId, partNo, file, start, end[, options])\n\nAfter initiating a Multipart Upload event, you can upload data in parts based on the specified object name and Upload ID.\n\nparameters:\n\n- name {String} object name\n- uploadId {String} get by initMultipartUpload api\n- partNo {Number} range is 1-10000, If this range is exceeded, OSS returns the InvalidArgument's error code.\n- file {File|String} is File or FileName, the whole file\u003cbr\u003e\n  Multipart Upload requires that the size of any Part other than the last Part is greater than 100KB. \u003cbr\u003e\n  In Node you can use File or FileName, but in browser you only can use File.\n- start {Number} part start bytes e.g: 102400\n- end {Number} part end bytes e.g: 204800\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- name {String} object name store on OSS\n- etag {String} object etag contains \", e.g.: \"5B3C1A2E053D763E1B002CC607C5A0FE\"\n\nexample:\n\n```js\n  const name = 'object';\n  const result = await store.initMultipartUpload(name);\n  const uploadId = result.uploadId;\n  const file; //the data you want to upload, is a File or FileName(only in node)\n  //if file part is 10\n  const partSize = 100 * 1024;\n  const fileSize = 10 * partSize;//you need to calculate\n  const dones = [];\n  for (let i = 1; i \u003c= 10; i++) {\n    const start = partSize * (i -1);\n    const end = Math.min(start + partSize, fileSize);\n    const part = await store.uploadPart(name, uploadId, i, file, start, end);\n    dones.push({\n      number: i,\n      etag: part.etag\n    });\n    console.log(part);\n  }\n\n  //end need to call completeMultipartUpload api\n```\n\n### .uploadPartCopy(name, uploadId, partNo, range, sourceData[, options])\n\nUsing Upload Part Copy, you can copy data from an existing object and upload a part of the data.\nWhen copying a file larger than 1 GB, you must use the Upload Part Copy method. If you want to copy a file smaller than 1 GB, see Copy Object.\n\nparameters:\n\n- name {String} object name\n- uploadId {String} get by initMultipartUpload api\n- partNo {Number} range is 1-10000, If this range is exceeded, OSS returns the InvalidArgument's error code.\n- range {String} Multipart Upload requires that the size of any Part other than the last Part is greater than 100KB, range value like `0-102400`\n- sourceData {Object}\n  - sourceKey {String} the source object name\n  - sourceBucketName {String} the source bucket name\n- [options] {Object} optional parameters\n  - [timeout] {Number} the operation timeout\n  - [versionId] {String} the version id of history object\n  - [headers] {Object} The following request header is used for the source objects specified by x-oss-copy-source.\n    - [x-oss-copy-source-if-match] default none\u003cbr\u003e\n      If the ETAG value of the source object is equal to the ETAG value provided by the user, the system performs the Copy Object operation; otherwise, the system returns the 412 Precondition Failed message.\n    - [x-oss-copy-source-if-none-match] default none\u003cbr\u003e\n      If the source object has not been modified since the time specified by the user, the system performs the Copy Object operation; otherwise, the system returns the 412 Precondition Failed message.\n    - [x-oss-copy-source-if-unmodified-since] default none\u003cbr\u003e\n      If the time specified by the received parameter is the same as or later than the modification time of the file, the system transfers the file normally, and returns 200 OK; otherwise, the system returns 412 Precondition Failed.\n    - [x-oss-copy-source-if-modi","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fali-sdk%2Fali-oss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fali-sdk%2Fali-oss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fali-sdk%2Fali-oss/lists"}