How to programmatically schedule a file deletion in Node.js or C++ on Ubuntu?

Is there a way to schedule a recently created file to be deleted on Linux using either Node.js or C++? I am running a server app that spawns a C++ executable (either could schedule the file deletion)