Collect js files when handling folders