Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ued2345/octopus-jsbridge

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ued2345/octopus-jsbridge

jsBridge Native&H5

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

目录结构说明

├── dist                       
│   ├── JsBridge.min.js           // 打包后的文件,也是被其它项目引入的文件
├── docs                          // 官方文档(待开发)
├── src
│   ├── api                       // 暴露客户端方法
│   │   │── std_decryptString.js  // 文件名同方法名 
│   │   │── .....
│   ├── utils
│   │   │──helper.js              // 工具类方法
│   │   │──jsBridge_android.js    // android端jsbridge封装
│   │   │──jsBridge_ios.js        // ios端jsbridge封装
│   │   │──jsBridge.js            // jsBridge入口文件 
│   ├── index.js                  // webpack entry入口文件
│   ├── types                     
│   │   │── index.d.ts            // index.d.ts 定义类型
├── webpack.config.js             // webpack配置文件 

API文档

JsBridge = {
    // js 调用 webview 方法
    callHandler: (name, params, callback) => void,

    // webview 调用 js
    registerHandler: (name, callback) => void,

    // 解密字符串
    std_decryptString: (data: string) => void,
    ...
}

安装使用

yarn add @ued2345/octopus-jsbridge -D

项目中调用

  • HTML项目
      <script src="JsBridge.min.js"></script>
      <script>
          window.JsBridge.std_decryptString('解密字符串').then(res => void)
      </script>
    
  • Node项目
    import { callHandler, registerHandler, std_decryptString } from '@ued2345/octopus-jsbridge'
    

Keywords

FAQs

Package last updated on 28 Oct 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc