Writing module compatible to both node and browser