@keqingrong/web-apis
v0.5.0
Published
Web APIs
Downloads
1
Readme
@keqingrong/web-apis (WIP)
Web APIs
Installation
# npm
npm install @keqingrong/web-apis
# yarn
yarn add @keqingrong/web-apis
Usage
import { chooseImage, getImageInfo } from '@keqingrong/web-apis';
(async () => {
const [imageUrl] = await chooseImage({
url: 'http://api.example.com/upload/image'
});
const { width, height, type } = await getImageInfo(imageUrl);
})();
APIs
- Base
base64ToArrayBuffer()
arrayBufferToBase64()
- Device
- Phone
makePhoneCall()
- Phone
- Media
- Image
getImageInfo()
(WIP)getBaseImageInfo()
chooseImage()
chooseImageFile()
chooseImageDataURL()
- Image
- Network
- Download
downloadFile()
- Download
- Route
navigateTo()
- File
saveFile()
saveImage()
saveJSON()
saveText()
- Internal Utils
- Base64
arrayBufferToBase64()
base64ToTypedArray()
base64ToArrayBuffer()
base64ToBlob()
toBase64()
fromBase64()
- Blob
blobToArrayBuffer()
/readAsArrayBuffer()
blobToDataURL()
/readAsDataURL()
blobToText()
/readAsText()
latin1ToTypedArray()
utf16ToTypedArray()
stringToTypedArray()
arrayBufferToString()
- Data URL
pareseDataURL()
dataURLToArrayBuffer()
dataURLToBlob()
dataURLToImageData()
- Download
saveBlobOrURL()
downloadFile()
- Image
imageToBlob()
imageToDataURL()
- URL
isHttpURL()
isHttpsURL()
isDataURL()
isBlobURL()
httpsToHttp()
parseURL()
parseScheme()
getSubdomain()
isSameOrigin()
isCorssOrigin()
isSameSite()
isCrossSite()
isSchemefulSameSite()
isSchemefulCrossSite()
- Base64
License
MIT © Qingrong Ke