openharmony-polyfill
v0.7.0
Published
Downloads
2
Readme
English | 简体中文
OpenHarmony Polyfill
This project is a polyfill that implements a subset of the standard web interface for OpenHarmony, currently includes the following Web APIs:
- ✅ XMLHttpRequest
- ✅ Fetch API
- ✅ WebSocket
- ✅ TextDecoder
- ✅ TextEncoder
- ⚠️ URL API
- ⚠️ Web Crypto API
- ⚠️ Web Storage API
- ❌ Web Workers API
Node.js API includes:
| Icon | Description | | ---- | ---- | |✅|support| |⚠️|partial support| |❌|not support now|
How to use?
- Run the following command to install in the OpenHarmony application project directory
npm install openharmony-polyfill --save
- Add import in the js entry file
import'openharmony-polyfill'
- Now you can use the standard Web API interface in your source code, such as
XMLHttpRequest
, or you can use third-party libraries that call the standard Web API, such asaxios
- For detailed usage, please refer to the examples in
examples