Is it possible to write a Windows service entirely in node.js?

I'm experimenting with using node.js beyond the server as a general-purpose scripting and application programming language.

One project on my TODO list would be a Windows service so I'm considering tackling it with node.js

I believe I have seen some kind of Windows API bindings for node.js but I don't know how complete or mainstream they are. (I'm willing to contribute!)

What would it take to implement a Windows service in node.js? (Trivial example appreciated.)

You should be able to do this very easily using Winser.

Try node-windows. It's similar to WinSer, but has more options.