first commit, works in node and browser