Support both node and browser usage