base for js with some globals