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

@bluesyoung/call-app

v0.1.1

Published

try call app

Downloads

8

Readme

浏览器唤端

目前只实现了基于 window.location.href 的唤端

使用

vue demo

使用包管理器

# 选择一个你喜欢的包管理器
# NPM
$ npm install @bluesyoung/call-app --save

# Yarn
$ yarn add @bluesyoung/call-app

# pnpm
$ pnpm add @bluesyoung/call-app
<script setup lang="ts">
import YoungCallApp from '@bluesyoung/call-app';
/**
 * 极简形态
 */
const callApp = new YoungCallApp({
  android_shceme: 'com.test.app',
  ios_shceme: 'com.test-ios.app',
  download: {
    ios: 'https://apps.apple.com/cn/app/xxx'
  },
  params: {
    key1: '111',
    key2: '222',
    key3: '333'
  },
  landpage: 'https://default.download.com'
});

/**
 * 完全形态
 */
const callApp = new YoungCallApp({
  android_shceme: 'com.test.app',
  ios_shceme: 'com.test-apple.app',
  download: {
    // 以下所有配置可选,若不配置则会使用兜底的落地页
    ios: '此处配置Apple应用商店中的地址',
    android: '此处配置安卓的下载链接',
    yyb: '此处配置应用宝的地址'
  },
  landpage: '兜底的落地页',
  path: 'scheme  的路径部分,可选',
  // 需要携带的参数
  params: {
    key1: 'value1',
    key2: 'value2',
    // ...
  }
}, {
  /* 可选配置 */
  // 唤端时间,默认 2.5 s
  timeout: 2500,
  startCall: () => console.log('---开始唤端---'),
  callFail: () => console.log('---唤端失败---'),
  // 受限环境中的处理函数
  mask: {
    wechat: () => {
      window.alert('目前处于微信内置浏览器中,不会执行常规的唤端操作')
    }
  }
});

const openHandler = () => callApp.call()
</script>

<template>
  <button @click="openHandler">启动APP</button>
</template>

浏览器直接引入

<!-- 国内推荐使用 jsdelivr -->
<script src="//cdn.jsdelivr.net/npm/@bluesyoung/call-app"></script>
<!-- or -->
<script src="//unpkg.com/@bluesyoung/call-app"></script>

<script>
const callApp = new window.YoungCallApp(config, options);

callApp.call();
</script>

开发环境

node: 16.13.1
pnpm: 6.26.1

开发

# 基于 vitest 的 TDD
pnpm dev
# 执行单元测试
pnpm test

# 基于 vite/rollup 打包
# tsup 打出来的包在部分环境下无法正常使用,所以目前只是用来生成 dts 文件
pnpm build

打包

# 产出所有格式的包
pnpm build