Electron is using nodejs, so you can still package cpp code as a node module and then use it as dependency in your electron app.
Here’s the docs for the latest node version (5.6 as time of writing), but you should probably look for one for the version of node shipped in electron: https://nodejs.org/api/addons.html
but when I try to implement it in the electron app its throws an error saying : could not locate binding file. Tried…(no error number even). what to do at such unknown error?