Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

265
Visualizações
How to use github javascript repositories on my webpage?

This has been bothering me for a long time, today I finally decided I need to get it solved. If this is off-topic, please kindly tell me where should I post this question.

I've been trying to use this javascript repository on github: https://github.com/jasondavies/d3-cloud. I know very little about github, node.js and npm, I just simply want to make a beautiful word cloud on my html page, but it seems everyone on github assume their readers are no newbies like me.

What I have tried:

  1. I have downloaded the .zip file and extracted them into a project folder. Then under the folder I create a test.html file:
 <head>
  <script src="/project/build/d3.layout.cloud.js"></script>
</head>
<body>
  <div id="test">

  </div>
</body>

The DOC is very simple. Without any actual example, I don't know how to get started. I've tried

d3.layout.cloud('#test').start();

It doesn't work at all. The DOC does mention examples, there are only two files under the example folder. They are all node.js javascript files. So I can't directly use it because they use require. So I tried to install them on my linux server.

  1. I create a project folder on my server, and then ran

    git clone https://github.com/jasondavies/d3-cloud.git

Now there are two folders under folder project: d3-cloud and node_modules. Not knowing if I have successfully installed it, I went into folder d3-cloud and ran

npm i

Now the whole folder structure is like this: enter image description here

I understand folder node_modules is dependencies but I am totally confused here.

  1. When I first did git clone did I already install the package?
  2. Is running npm i redundant? But it does create another node_modules folder and install a lot of things under it as the screenshot below shows: enter image description here Are these all dependencies of this javascript app? So many?
  3. At this point, do I HAVE TO use some bundling tools such as webpack(I merely know the name upon some brief google search) in order to use the .js file on my webpage?
about 4 years ago · Santiago Gelvez
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda