Proper return of js module