That dose not seems the make sens. Why no just Puid.generate() instead of var puid = new Puid(); puid.generate();