I have written some code for capturing image using nodejs and I have used npm base64-to-image, but it's not working properly. Below is the code:
var base64Str = policyObj.image;
var path ='public/images/';
var optionalObj = {'fileName': 'policyimg', 'type':'png'};
base64ToImage(base64Str,path,optionalObj);
Please let me know where I am going wrong.