{"id":18317627,"url":"https://github.com/shimohq/awos-js","last_synced_at":"2025-04-05T21:32:26.228Z","repository":{"id":34302970,"uuid":"175342797","full_name":"shimohq/awos-js","owner":"shimohq","description":"AWOS-JS: Wrapper For Aliyun OSS And Amazon S3","archived":false,"fork":false,"pushed_at":"2024-05-06T09:05:19.000Z","size":418,"stargazers_count":15,"open_issues_count":2,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-17T21:13:19.966Z","etag":null,"topics":["aws","minio","oss"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shimohq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-13T03:54:22.000Z","updated_at":"2024-08-14T09:26:32.000Z","dependencies_parsed_at":"2023-02-15T15:16:54.785Z","dependency_job_id":null,"html_url":"https://github.com/shimohq/awos-js","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimohq%2Fawos-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimohq%2Fawos-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimohq%2Fawos-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shimohq%2Fawos-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shimohq","download_url":"https://codeload.github.com/shimohq/awos-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406082,"owners_count":20933803,"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":["aws","minio","oss"],"created_at":"2024-11-05T18:06:56.950Z","updated_at":"2025-04-05T21:32:25.858Z","avatar_url":"https://github.com/shimohq.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"AWOS-JS: Wrapper For Aliyun OSS And Amazon S3\n====\n\n![npm](https://img.shields.io/npm/v/awos-js)\n\nawos for golang:  https://github.com/shimohq/awos\n\n## feat\n\n- same usage and methods for aws \u0026 oss, pretty convenient!\n- add retry strategy\n- avoid 404 status code:\n    - `get(key: string, metaKeys?: string[]): Promise\u003cIGetObjectResponse | null\u003e` will return null when object not exist\n    - `head(key: string): Promise\u003cMap\u003cstring, string\u003e | null\u003e` will null when object not exist\n\n## installing\n\n```\nnpm i awos-js --save\n```\n\n## how to use\n\n```javascript\n// for typescript\nimport AWOS from 'awos-js'\n\n// for js\nconst AWOS = require('awos-js')\n```\n\n### for Aliyun OSS\n\n```javascript\nconst client = new AWOS.Client({\n  type: 'oss',\n  ossOptions: {\n    accessKeyId: 'accessKeyId',\n    accessKeySecret: 'accessKeySecret',\n    bucket: 'bucket',\n    endpoint: 'endpoint',\n  }\n})\n```\n\n### for Amazon S3(minio)\n\n```javascript\nconst client = new AWOS.Client({\n  type: 'aws',\n  awsOptions: {\n    accessKeyId: 'accessKeyId',\n    secretAccessKey: 'secretAccessKey',\n    bucket: 'bucket',\n    // when use minio, S3ForcePathStyle must be set true\n    // when use aws, endpoint is unnecessary and region must be set\n    region: \"region\",\n    endpoint: 'endpoint',\n    s3ForcePathStyle: true,\n  }\n})\n```\n\nthe available operation：\n\n```javascript\nget(key: string, metaKeys?: string[]): Promise\u003cIGetObjectResponse | null\u003e;\ngetAsBuffer(key: string, metaKeys: string[]): Promise\u003cIGetBufferedObjectResponse | null\u003e;\nput(key: string, data: string | Buffer, options?: IPutObjectOptions): Promise\u003cvoid\u003e;\ndel(key: string): Promise\u003cvoid\u003e;\ndelMulti(keys: string[]): Promise\u003cstring[]\u003e; // return keys not deleted\nhead(key: string, options?: IHeadOptions): Promise\u003cMap\u003cstring, string\u003e | null\u003e;\nlistObject(key: string, options?: IListObjectOptions): Promise\u003cstring[]\u003e;\nlistDetails(key: string, options?: IListObjectOptions): Promise\u003cIListObjectOutput\u003e;\nsignatureUrl(key: string, options?: ISignatureUrlOptions): Promise\u003cstring | null\u003e;\ncopy(key: string, source: string, options?: ICopyObjectOptions): Promise\u003cvoid\u003e;\n```\n\n### Change Log\n\n- v2.0.0 / 2020-06-18\n  - Breaking\n    - conbine parameters `meta`,`contentType`,`headers` of `AWOS.put` into `options`\n  - add `headers` option support for `put` method\n\n- v1.0.4 / 2019-12-26\n  - support buffer in get and put operation\n\n- v1.0.3 / 2019-03-28\n  - put() support contentType params\n\n- v1.0.2 / 2019-03-26\n  - support signatureUrl() operation\n\n- v1.0.1 / 2019-03-19\n  - bug fix: oss listObject() should return [] when options.prefix not exist in the bucket; oss listObject() maxKeys not working\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshimohq%2Fawos-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshimohq%2Fawos-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshimohq%2Fawos-js/lists"}