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

dfu-js

v0.2.1

Published

a web bluetooth library for performing DFU of Nordic Semiconductor SOCs. Includes Vue.js Mixin for simplifed use.

Downloads

34

Readme

dfu-js

This JS library was build against Nordic Semiconductors nRF SDK 12.3 using the secure bootloader. The library requires Chrome 56 on Linux and Mac and Chrome 70 on Windows 10 which is partial support for Web Bluetooth was introduced. Other browswers have not fully or partially implemented Web Bluetooth.

The package also includes a Vue.js Mixin that sets up few useful computed properties. See this gist of a vue component.

A demo web applicatiion using this library and web-bluetooth-vuex is available here, Chrome only.

Installation

$ yarn add dfu-js
# OR
$ npm install dfu-js

Usage

an semi pseduo code example on how to use the library straight.

import {StateMachine, StateMachineStates, Firmware, DFUServiceUUID, DFUCharacteristicUUID} from 'dfu-js'
import JSZip from 'jszip'

/**
... Assume you discovered a ble device and aquired the service and
    characteristic needed. Servie uuid  DFUServiceUUID.DFU and characteristics
    DFUCharacteristicUUID.PacketPoint, DFUCharacteristicUUID.ControlPoint
**/

//Create a dfu object with the characteristics
const dfu = StateMachine(deviceControlPoint, devicePacketPoint)

/**
  load fileContentStream from a url or a local file
**/
const zip = new JSZip()
await zip.loadAsync(fileContentStream)
const dfuFirmware = new Firmware(zip)
await dfuFirmware.parseManifest()

/**
  Register for events fired by the dfu
**/
dfu.on('progressChanged', (payload) => console.log(payload))
dfu.on('stateChanged', (payload) => console.log(payload) )

/**
  Finally send the firmware update and await the callbacks to indicate
  sucess or failure. Besides the callvack the current state is expressed in
  dfu.state and dfu.progress
**/
dfu.sendFirmware(dfuFirmware)