Integrate pc-nrfprog-js in an electron app


I am trying to develop an electron app to program the DFU with *.zip firmware file generated by nrfutil. I looked at the nrfprog-js api and want to use the following function

    progress => {
    err => {
      if (err) throw err;

I have a few questions:

1. What are the requirements to add this library to my electron project? When I did `yarn add pc-nrfprog-js` I wasn't able to package it. Later when I looked at pc-nrfconnect-programmer and pc-nrfconnect-core then I realised there were lot of boilerplate codes to integrate this library with electron. I need help with setup. The app source code can be found here - 

2. I want user to do a simple one click download of the app and not install any external tools like Jlink. Is it possible to use pc-nrfprog-js without the tool?

PS - Refrain from suggesting to start from pc-nrfconnect-boilerplate.


  • Considering the complexity of pc-nrfjprog-js with electron, I am trying to add `pc-nrf-dfu-js` in my project. I am trying to run the following code in my project:

          .then(updates => {
            const serialTransport = new DfuTransportSerial(serialPort, 16)
            const dfuOperation = new DfuOperation(updates, serialTransport)
            console.log('Starting Bootloader DFU')
          .then(() => {
            console.log('Bootloader DFU completed successfully!')

    I get the following error:

    DfuError: Error message: Timeout while reading from serial transport. 

    Any hint on what could be the issue? What am I doing wrong here?