Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

Is it possible to have OS X notify my node.js app when the computer is entering sleep or shutting down? Seems like it should be, but I haven't been able to find anything node.js related. I did find this but it's talking about Cocoa apps. Maybe I could have some other app (like Cocoa) receive the sleep notification and pass that to node.js?

I'd love to hear any suggestions that might point me in the right direction.

share|improve this question
    
I wasn't sure if this should be in Stack Overflow or Ask Different. But I figured this was more a programming question than an OS X specific question. Sorry if I'm in the wrong place. – tyler mackenzie 19 mins ago
    
I don't see anything in the OS module where I would expect this to be. My guess is that you could use node's Child Process to spawn a shell (or some other language) script listening for this that then notifies the parent node process. – Matthew Herbst 8 mins ago
    
This may help apple.stackexchange.com/questions/27036/… – Rob M. 7 mins ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.