Nutmeg Pumpkin Macchiato

    ali-oss-tiny

    1.0.3 • Public • Published

    Ali-OSS-tiny

    Browser only ali-oss multipart upload

    No IE support

    Supported

    • .put(name,file, headers)
    • .multipartUpload(name,file, {headers,partSize,onProgress})
    • .setOptions(sts)

    Install

        yarn add ali-oss-tiny
        npm install ali-oss-tiny

    How to use

    import TinyOSS from "ali-oss-tiny";
    const sts = {
    	region,
    	accessKeyId,
    	accessKeySecret,
    	stsToken,
    	bucket,
    	secure,
    	endpoint,
    };
    const oss = new TinyOSS(sts);
    // or
    // oss.setOptions(sts)
    //  oss.multipartUpload(name,file, {headers?, partSize?})
    const multipartResult = await oss.multipartUpload(file.name, file);
    console.log(multipartUploadResult);
    		//  {
    		// 	url: "the url",
    		// 	headers:string,
    		// 	etag: "etag",
    		// 	name: "key",
    		// 	status
    		// }
    // oss.put(name,file, headers?)
    const putResult = await oss.put(file.name, file, headers);
    console.log(putResult);
    		//  {
    		// 	url: "the url",
    		// 	headers:string,
    		// 	etag: "etag",
    		// 	name: "key",
    		// 	status
    		// }
    };

    Keywords

    none

    Install

    npm i ali-oss-tiny

    DownloadsWeekly Downloads

    7

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    13.2 kB

    Total Files

    4

    Last publish

    Collaborators

    • fizwen