
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
lm-rn-alioss
Advanced tools
AliYun oss for react native,支持 Android + iOS,感谢aliyun-oss-react-native提供的基础。 首先向各位声明,本库是在 aliyun-oss-react-native 基础上进行重写,但因常年未曾维护,旧版SDK 等问题,最终决定开一个新仓库,提供给新项目使用。
npm install rn-alioss
or
yarn add rn-alioss
cd ios
pod install
do nothing (The Gradle will automatically import rn-alioss )
This section describes the APIs that are currently implemented and partially supported by the React Native SDK. These APIs mainly cover log management, bucket management, object management, authorization, file upload, and download. Follow-up to improve the relevant API and BUG repair. API list is as follows
API | Android | iOS |
---|---|---|
enableDevMode | Y | Y |
initWithPlainTextAccessKey | Y | Y |
initWithSecurityToken | Y | Y |
initWithServerSTS | Y | Y |
asyncUpload | Y | Y |
initMultipartUpload | Y | Y |
multipartUpload | Y | Y |
listParts | Y | Y |
abortMultipartUpload | Y | Y |
asyncDownload | Y | Y |
asyncCreateBucket | Y | Y |
asyncGetBucketACL | Y | Y |
asyncListBuckets | Y | Y |
asyncDeleteBucket | Y | Y |
asyncHeadObject | Y | Y |
asyncListObjects | Y | Y |
doesObjectExist | Y | Y |
doesObjectExist | Y | Y |
asyncDeleteObject | Y | Y |
import { AliyunOSS } from "rn-alioss";
declare type OSSinit = {
maxRetryCount: number;
timeoutIntervalForRequest: number;
timeoutIntervalForResource: number;
};
declare type OssListOptions = {
prefix: string;
marker?: string;
maxKeys?: string;
delimiter?: string;
};
declare type AppendType = {
appendPosition: number;
contentType: string;
contentMd5: string;
contentEncoding: string;
contentDisposition: string;
};
AliyunOSS.enableDevMode();
init auth client with accessKeyId and accessKeySecret,please refer to the code.you can use ,but we do not suggest use it。
const endPoint = "https://xxx"
const configuration = {
maxRetryCount: 3,
timeoutIntervalForRequest: 30,
timeoutIntervalForResource: 24 * 60 * 60
};
AliyunOSS. initWithPlainTextAccessKey(accessKey: string, secretKey: string, endPoint: string, configuration?: OSSinit): void;
init client with SecurityToken
AliyunOSS.initWithSecurityToken(securityToken: string, accessKey: string, secretKey: string, endPoint: string, configuration?: OSSinit): void;
AliyunOSS.asyncUpload(bucketName: string, objectKey: string, filepath: string, options?: {}): Promise<any>;
AliyunOSS.asyncAppendObject(bucketName: string, objectKey: string, filepath: string, options?: AppendType): Promise<any>;
AliyunOSS.asyncResumableUpload(bucketName: string, objectKey: string, filepath?: string, options?: {}): Promise<any>;
AliyunOSS.initMultipartUpload(bucketName: string, objectKey: string): Promise<any>;
//uploadId is the value When call initMultipartUpload ,success callback return
AliyunOSS.abortMultipartUpload(bucketName: string, objectKey: string, uploadId: string): Promise<any>;
AliyunOSS.listParts(bucketName: string, objectKey: string, uploadId: string): Promise<any>;
AliyunOSS.abortMultipartUpload(bucketName: string, objectKey: string, uploadId: string): Promise<any>;
AliyunOSS. asyncDownload(bucketName: string, objectKey: string, filepath?: string, options?: {
'x-oss-process': string;
}): Promise<any>;
AliyunOSS. asyncCreateBucket(bucketName: string, acl: string | undefined, region: string):
AliyunOSS.asyncGetBucketACL(bucketName: string): Promise<any>;
AliyunOSS.asyncListBuckets(): Promise<any>;
AliyunOSS.asyncDeleteBucket(bucketName: string): Promise<any>;
AliyunOSS.asyncHeadObject(bucketName: string, objectKey: string): Promise<any>;
list objects in some conditions
parameters:
prefix
keymarker
, including marker
key100
, limit to 1000
AliyunOSS.asyncListObjects(bucketName: string, options?: OssListOptions | undefined): Promise<any>;
AliyunOSS.doesObjectExist(bucketName: string, objectKey: string): Promise<any>;
AliyunOSS.asyncCopyObject(srcBucketName: string, srcObjectKey: string, desBucketName: string, destObjectKey: string, options: any): Promise<any>;
AliyunOSS. asyncDeleteObject(bucketName: string, objectKey: string): Promise<any>;
See the contributing guide to learn how to contribute to the repository and the development workflow.
FAQs
aliyun oss for react native
The npm package lm-rn-alioss receives a total of 1 weekly downloads. As such, lm-rn-alioss popularity was classified as not popular.
We found that lm-rn-alioss demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.