support for browser and nodejs