How can I avoid cache with require('c++addon'). I have an addon but will like to have a new one every time.
e.g
for(...)
addon[i] = require('addon'); // I want a new one everytime
addon[i].somefunction(); //
Thank you.
You will have to refactor your addon module so it exposes a function to construct these instances, e.g.
const myAddon = require('addon');
objects = [myAddon.create(), myAddon.create(), myAddon.create()];
objects[0].somefunction();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With