This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Integrate pc-nrfprog-js in an electron app

Hi,

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

nrfjprog.programDFU(
    device.serial,
    downloadLocation,
    device.path,
    15000,
    progress => {
      console.log(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 - https://github.com/baymac/cypherock-live-desktop/ 

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.

Thanks.

Related