update JS interface to use CommonJS convention