Misc JS/node utility functions