Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Temp files not deleted #20

mattlockyer opened this Issue · 4 comments

2 participants


Hi I'm using your module with supervisor and have set up my server to recompile all my js and css when the server reboots due to a file change.

Problem is that your code seems to spit out a lot of temp files and not cleaning them up.

Is there any way you can add a simple -cleanup style parameter to the options so these can be deleted automatically?

Thanks :dancer:



Temp files are deleting with "_fs.unlinkSync(self.tempFile)".
What options do you use ?


Well all I'm doing is calling your method:

new compressor.minify({
type: 'no-compress',
fileIn: files,
fileOut: 'public/css/main.min.css',
tempPath: '../tmp',
callback: function(err){
console.log("Compressed CSS, error: " + err);

Perhaps when I'm using supervisor it's stopping and restarting before your callbacks can be called and the temp files deleted?

It basically looks when files are modified and then reboots the server.

Do you perform all the cleanup before the final file is outputted?


Can you try with a / in your tempPath ? tempPath: '../tmp/'
Otherwise, here is the order :

  • file creation
  • cleanup temp files
  • callback

I was testing some others possibilities, all seems good.
But, yes it can be a possibility, if your supervisor kills the process before the end of the minification.


That didn't work, I still get a bunch of temp files in my main application directory.

I believe it was the aforementioned problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.