Adding custom Node.js hooks