Skip to content

keqingrong/web-apis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8a381d9 · Nov 6, 2021

History

41 Commits
Jan 13, 2021
Nov 5, 2021
Nov 6, 2021
Apr 25, 2021
Jan 3, 2021
Nov 5, 2021
Jan 2, 2021
Nov 5, 2021
Jan 2, 2021
Nov 5, 2021
Nov 5, 2021
Apr 25, 2021
May 19, 2021

Repository files navigation

@keqingrong/web-apis (WIP)

npm version

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()
  • Media
    • Image
      • getImageInfo() (WIP)
      • getBaseImageInfo()
      • chooseImage()
      • chooseImageFile()
      • chooseImageDataURL()
  • Network
    • Download
      • downloadFile()
  • 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()

License

MIT © Qingrong Ke

About

Web APIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published