{"id":18589636,"url":"https://github.com/alex1990/tiny-oss","last_synced_at":"2025-04-10T15:31:09.988Z","repository":{"id":54975589,"uuid":"191402166","full_name":"Alex1990/tiny-oss","owner":"Alex1990","description":"A tiny aliyun oss sdk for browser which focus on uploading.","archived":false,"fork":false,"pushed_at":"2021-01-18T15:29:23.000Z","size":43,"stargazers_count":28,"open_issues_count":1,"forks_count":8,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-03T22:43:28.367Z","etag":null,"topics":["aliyun","oss"],"latest_commit_sha":null,"homepage":"","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/Alex1990.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-11T15:39:50.000Z","updated_at":"2025-02-19T08:09:44.000Z","dependencies_parsed_at":"2022-08-14T08:00:16.615Z","dependency_job_id":null,"html_url":"https://github.com/Alex1990/tiny-oss","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alex1990%2Ftiny-oss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alex1990%2Ftiny-oss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alex1990%2Ftiny-oss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alex1990%2Ftiny-oss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alex1990","download_url":"https://codeload.github.com/Alex1990/tiny-oss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248243452,"owners_count":21071054,"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":["aliyun","oss"],"created_at":"2024-11-07T00:52:51.385Z","updated_at":"2025-04-10T15:31:09.721Z","avatar_url":"https://github.com/Alex1990.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tiny-oss\n\nA tiny aliyun oss sdk for browser which focus on uploading. Less than 10kb (min+gzipped).\n\n**English | [简体中文](README_zh-CN.md)**\n\n## Installation\n\nNpm\n\n```sh\nnpm install tiny-oss\n```\n\nYarn\n\n```sh\nyarn add tiny-oss\n```\n\n## Usage\n\n### Basic\n\n```js\nconst oss = new TinyOSS({\n  accessKeyId: 'your accessKeyId',\n  accessKeySecret: 'your accessKeySecret',\n  // Recommend to use the stsToken option in browser\n  stsToken: 'security token',\n  region: 'oss-cn-beijing',\n  bucket: 'your bucket'\n});\n\nconst blob = new Blob(['hello world'], { type: 'text/plain' });\n\n// Upload\noss.put('hello-world', blob);\n```\n\n### Upload progress\n\nYou can specify the third parameter to monitor the upload progress data:\n\n```js\n// Upload progress\noss.put('hello-world', blob, {\n  onprogress (e) {\n    console.log('total: ', e.total, ', uploaded: ', e.loaded);\n  }\n});\n```\n\nMore options or methods see [API](#api).\n\n## Compatibility\n\nThis package depends on some modern Web APIs, such as [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob), [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), [FileReader](https://developer.mozilla.org/en-US/docs/Web/API/FileReader), [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n\nSo, it should work in the below browsers.\n\n* Chrome \u003e= 20\n* Edge \u003e= 12\n* IE \u003e= 10\n* Firefox \u003e= 4\n* Safari \u003e= 8\n* Opera \u003e= 11\n* Android \u003e= 4.4.4\n* iOS \u003e= 8\n\n**For IE and low version FireFox, you should import a promise polyfill, such as [es6-promise](https://github.com/stefanpenner/es6-promise)**.\n\n## API\n\n```js\nnew TinyOSS(options)\n```\n\n### options\n\nPlease check [Browser.js offical document](https://help.aliyun.com/document_detail/64095.html?spm=a2c4g.11186623.6.1122.27976928XhTpTr).\n\n* accessKeyId\n* accessKeySecret\n* stsToken\n* bucket\n* endpoint\n* region\n* secure\n* timeout\n\n### put(objectName, blob, options)\n\nUpload the blob.\n\n#### Arguments\n\n* **objectName (String)**: The object name.\n* **blob (Blob|File)**: The object to be uploaded.\n* **[options (Object)]**\n  + **[onprogress (Function)]**: The upload progress event listener receiving an [progress event](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/progress_event) object as an parameter.\n\n#### Return\n\n* **(Promise)**\n\n### putSymlink(objectName, targetObjectName)\n\nCreate a symlink.\n\n#### Arguments\n\n* **objectName (String)**: The symlink object name.\n* **targetObjectName (String)**: The target object name.\n\n#### Return\n\n* **(Promise)**\n\n### signatureUrl(objectName, options)\n\nGet a signature url to download the file.\n\n#### Arguments\n\n* **objectName (String)**: The object name.\n* **[options (Object)]**:\n  + **[options.expires (Number)]**: The url expires (unit: seconds).\n\n#### Return\n\n* **(String)**\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex1990%2Ftiny-oss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falex1990%2Ftiny-oss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex1990%2Ftiny-oss/lists"}