npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kiwi-bridge

v1.2.14

Published

javascript bridge libaray

Downloads

85

Readme

kiwi-bridge

kiwi bridge 是一款跨端应用框架,主要用于React NativeJS之间桥(jsBridge)通信, 以及提供在浏览器环境中WEB应用的通用工具库。

npm下载包

内网下载
anpm install @pa/kiwi-bridge --save

外网下载
npm install kiwi-bridge --save

引入项目中

内网引入
import kiwi from '@pa/kiwi-bridge';

外网引入
import kiwi from 'kiwi-bridge';

⚠️注意:@pa/kiwi-bridge默认用于非浏览器环境,如果要用于浏览器环境请引入@pa/kiwi-bridge/dist/kiwi-bridge.umd

调用方式

native 端和 H5 页面调用组件的方式一致。

kiwi.[组件名].[组件方法](参数对象)

/**
* @param options 
* - {String} component 组件
* - {String} action 方法
* - {Object} data 调用参数
* - {Function} success 成功回调函数, 可选
* - {Function} fail 失败回调函数, 可选
* - {Function} complete 完成回调函数, 可选
*/
kiwi.http.request({
  data: {
    url: '/api',
    method: 'get',
    params: { name: 'test' }
  },
  success: function(res) { },
  fail: function(err) { }
})

支持多种JS规范

kiwi-bridge 支持服务端CommonJS规范、ES Module规范和浏览器环境script引入,默认导出ES Module规范。

  • ES Module规范引入 kiwi-bridge.js
import kiwi from 'kiwi-bridge';
  • CommonJS规范引入 kiwi-bridge.cjs
const kiwi = require('kiwi-bridge');
  • 浏览器环境script引入
<script src="dist/kiwi-bridge.runtime.js"></script>

Native 组件列表及组件方法

Native-Components
├── ApolloMobile
│   └── getData
├── CMServicePush
│   ├── registerPushKey
│   └── unRegisterPushKey
├── GMCrypto
│   ├── dataConvert
│   ├── verify
│   ├── sdkVersion
│   ├── generateSymmKey
│   ├── encrypt
│   └── decrypt
├── Header
│   ├── config
│   └── toggle
├── Http
│   ├── request
│   ├── upload
│   ├── download
│   └── onlineImage
├── InfoData
│   ├── trackEvent
│   ├── onPageStart
│   ├── addGlobalParameter
│   ├── getGlobalParameter
│   ├── removeGlobalParameter
│   ├── traceExpose
│   ├── tracePageRendering
│   ├── traceRemoteCall
│   ├── traceAreaExpose
│   ├── traceContentExpose
│   ├── traceBusinessPoint
│   └── getConversationInfomations
├── Loading
│   ├── start
│   ├── stop
│   ├── startInWebView
│   └── stopInWebView
├── Navigator
│   ├── forward
│   ├── replace
│   ├── back
│   ├── backTop
│   └── close
├── Page
│   ├── bounce
│   ├── swipe
│   ├── config
│   └── getEnv
├── LocalStorage
│   ├── getItem
│   ├── setItem
│   ├── removeItem
│   └── clear
├── SessionStorage
│   ├── getItem
│   ├── setItem
│   ├── removeItem
│   └── clear
├── SystemKeyboard
│   ├── showKeyboard
│   └── hideKeyboard
├── Timer
│   └── getTimeStamp
└── Universal
    └── traceUniversalPoint

Web 组件列表及组件方法

web-components
├── Application
│   ├── getEnvironment
│   ├── getSimpleEnvironmentSync
│   ├── getSimpleEnvironmentAsync
│   └── getServerTime
├── Audio
│   ├── play
│   ├── stop
│   └── pause
├── Browser
│   └── open
├── Camera
│   ├── getDataUrl
│   └── getPhotos
├── Dialog
│   ├── alert
│   └── confirm
├── Email
│   └── send
├── Http
│   └── request
├── Loading
│   ├── start
│   └── stop
├── LocalStorage
│   ├── getItemSync
│   ├── getItem
│   ├── setItemSync
│   ├── setItem
│   ├── removeItem
│   ├── removeItemSync
│   ├── clear
│   └── clearSync
├── Navigator
│   ├── forward
│   ├── back
│   ├── backTop
│   ├──replace
│   └── close
├── Network
│   └── getInfo
├── SessionStorage
│   ├── getItemSync
│   ├── getItem
│   ├── setItemSync
│   ├── setItem
│   ├── removeItem
│   ├── removeItemSync
│   ├── clear
│   └── clearSync
├── SharedMemory
│   ├── setItem
│   ├── getItem
│   ├── removeItem
│   └── clear
├── Toast
│   └── show
├── Wxloginfree
│   └── init
└── Wxworkloginfree
    └── init