foo-singleton.js 213 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 var path = require('path'); function FooSingleton() { } var instance = null; exports.getInstance = function() { if (instance === null) { instance = new FooSingleton(); } return instance; };