collect library javascript