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

@unovo/blu-opendoor

v1.1.18

Published

小程序蓝牙开门组件

Downloads

27

Readme

注意在使用科技侠服务的时候需要在小程序app.js中配蓝牙插件并在小程序后台加入此插件, 榉树则不需要

// App配置
  config = {
   ....其他
    'plugins': {
      // 蓝牙门锁插件
      'ScienerPlugin': {
        'version': '1.1.3',
        'provider': 'wx3107f0a218053d99'
      }
    }
  }

蓝牙开门服务,目前包含榉树和科技侠开门

这个内容已经发布到npm上,需要修改代码可拉取本代码,修改src中内容后npm run build 出lib目录,lib目录才是真正发布到npm的目录

发布到npm的步骤

  • npm run build 编辑es6文件到es5模式

  • npm version ? 可以使用以下这些命令

  • major: 主版本号
  • premajor: 预备主版本
  • minor: 次版本号
  • preminor: 预备次版本
  • patch: 修订号
  • prepatch: 预备修订版
  • prerelease: 预发布版本
  • npm adduser 登录npm 接下来会以问答的形式向你了解你的用户名、密码以及公开的邮箱,之后输入

  • npm publish 进行发布

如何使用

  • 安装 npm install @unovo/blu-opendoor --save

  • 引入 import { jushuService, kjxService } from '@unovo/blu-opendoor';

  • 使用榉树服务

  const jushuBluService = new jushuService();
    // 参数1:指令,参数2:mac, 参数3:回调
    jushuBluService.begin(cmd, key.lockMac, (result) => {
      this.openDoorBack({
        success: result.errorCode, // 是否开门成功,1:成功,0:失败,
        errMsg: result.errMsg,
        electricQuantity: result.electricQuantity
      });
      if (result.errorCode == 1) {
        this.openDoorSuccess(result);
      } else {
        this.openDoorFail(result);
      }
    });
  • 使用科技侠服务
  const kjxBluService = new kjxService();
    // 参数1:门锁信息,参数2:回调
    kjxBluService.begin(key, (result) => {
      if (result.success == 1 || result.errorCode == 0) {
        result.success = 1;
        this.openDoorBack(result);
        this.openDoorSuccess(result);
      } else {
        result.success = 0;
        this.openDoorBack(result);
        this.openDoorFail(result);
      }
    });