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 🙏

© 2026 – Pkg Stats / Ryan Hefner

fescoapp-jsbridge

v1.0.3

Published

fescoapp原生与h5交互的jsbridge

Readme

FescoApp-JsBridge

fescoapp 原生与 h5 交互的 jsbridge

使用示例

App 上传身份证正反面

支持平台 Android / IOS

import { appUpIdCardImage } from 'fescoapp-jsbridge'
// 调用原生-上传身份证正反面
async appUpIdCardImage () {
  try {
    const result = await appUpIdCardImage({
      idCode: 189, // 本人及其配偶的类型 如果是身份证正面传189,身份证背面传190
      idType: 1, // 拍摄的证件类型 1.仅仅拍摄身份证的正面 2.仅仅拍摄身份证的反面  3.拍摄身份证的正反面 如果不传任何参数默认拍摄正反面
      formData: {}, //  HTTP 请求中其他额外的 formdata
    })
    console.log(result)
  } catch (error) {
    console.log(error)
  }
}

App 统一上传图片

支持平台 Android / IOS

import { appUploadPic } from 'fescoapp-jsbridge'
// 调用原生-统一上传图片
async appUploadPic () {
  try {
    // 先获取headers,作为后续参数使用
    const headersInfo = await getHeaders()
    const result = await appUploadPic({
      sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有
      maxCount: 1, // 文件上传最大数量,默认 1
      compressedMaxSize: 1024, // 上传文件的最大文件大小,单位为 byte.
      targetHost: "http://123.123.123.123/aa/aa/aa/uploadFile", // 必传,目标服务器地址,此处仅为示例
      headers: {
        "Fesco-Token": headersInfo?.FescoToken || "",
        "Fesco-Sign": headersInfo?.FescoSign || "",
        "Fesco-Model": headersInfo?.FescoModel || "",
        "Fesco-Version": headersInfo?.FescoVersion,
        "Fund-Source": headersInfo?.FundSource,
        "User-agent": headersInfo?.UserAgent || "",
        "Fesco-Source": "h5",
      }, // HTTP 请求 Headers,根据业务要求传入
      formData: {}, //  HTTP 请求中其他额外的 formdata
    })
    console.log(result)
  } catch (error) {
    console.log(error)
  }
}

获取 App 请求头

支持平台 Android / IOS

import { getHeaders } from 'fescoapp-jsbridge'
// 调用原生-获取App请求头
async getHeaders () {
  try {
    const result = await getHeaders()
    console.log(result)
  } catch (error) {
    console.log(error)
  }
},

获取定位

支持平台 Android / IOS

import { getLocation } from 'fescoapp-jsbridge'
// 调用原生-获取定位
async getLocation () {
  try {
    const result = await getLocation({
      type: "wgs84", // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入"gcj02"
    })
    console.log(result)
  } catch (error) {
    console.log(error)
  }
}

获取用户步数信息

支持平台 Android / IOS

import { getStepCount } from 'fescoapp-jsbridge'
// 调用原生-获取用户步数信息
async getStepCount () {
  try {
    const result = await getStepCount({showDialog: true})
    console.log(result)
  } catch (error) {
    console.log(error)
  }
}

三方小程序接入

支持平台 Android / IOS

import { openMiniProgram } from 'fescoapp-jsbridge'
// 调用原生-三方小程序接入
async openMiniProgram () {
  try {
    const result = await openMiniProgram({
      userName: "gh_aaaaaaaaaaaa", // 微信原始小程序id,此处仅为示例
      path: "pages/index/index", //  拉起小程序页面的可带参路径,不填默认拉起小程序首页,对于小游戏,可以只传入 query 部分
      name: "目标小程序名称", // 跳转的目标小程序名称
      showDialog: true, // 是否展示用户提示弹窗,true 展示, false 不展示
    })
    console.log(result)
  } catch (error) {
    console.log(error)
  }
}

保存图片

支持平台 Android / IOS

import { saveImage } from 'fescoapp-jsbridge'
// 调用原生-保存图片
async saveImage () {
  try {
    const result = await saveImage({
      imgUrl: "https://res.wx.qq.com/t/wx_fed/weixin_portal/res/static/img/1L3ryyg.png", // 需要保存图片的网络地址
    })
    console.log(result)
  } catch (error) {
    console.log(error)
  }
}

设置是否展示导航栏

支持平台 Android / IOS

import { setNavigationBar } from 'fescoapp-jsbridge'
// 调用原生-设置是否展示导航栏
async setNavigationBar () {
  try {
    const result = await setNavigationBar({
      show: "false", // 是否展示,bool值,默认false
    })
    console.log(result)
  } catch (error) {
    console.log(error)
  }
}

启用/禁用网页侧滑返回

支持平台 Android

import { setSideBackGesture } from 'fescoapp-jsbridge'
// 调用原生-启用/禁用网页侧滑返回,安卓端已实现,安卓未实现
async setSideBackGesture () {
  try {
    const result = await setSideBackGesture(
      {
        yesOrNo: "0", // 0:禁用,1 启用
      }
    )
    console.log(result)
  } catch (error) {
    console.log(error)
  }
}

统一分享

支持平台 Android / IOS

import { updateAppMessageShareData } from 'fescoapp-jsbridge'
// 调用原生-统一分享
async updateAppMessageShareData () {
  try {
    const result = await updateAppMessageShareData({
      title: "分享标题", // 分享标题
      desc: "分享描述", // 分享描述
      link: "www.baidu.com", // 分享链接,该链接域名或路径
      imgUrl: "https://res.wx.qq.com/t/wx_fed/weixin_portal/res/static/img/1L3ryyg.png", // 分享图标
      shareType: "", // 分享的渠道  1:微信好友 2:朋友圈 3:复制链接分享 什么都不写或其它默认全部分享渠道
    })
    console.log(result)
  } catch (error) {
    console.log(error)
  }
}

实名认证

支持平台 Android / IOS

import { userAuth } from 'fescoapp-jsbridge'
// 调用原生-实名认证
async userAuth () {
  try {
    const result = await userAuth({
      showDialog: true,
    })
    console.log(result)
  } catch (error) {
    console.log(error)
  }
}