javascript: generating NPM main file