how to write js module