O GoConqr está de visual novo! Conte para nós o que você achou.

Módulo 9 de 14 · Texto

Important Core Modules

Tomas Katz

  • path
    • path.normalize
    • path.join
    • path.dirname, path. basename, path.extname
  • fs (file-system)
  • os (operating-system)
  • util (general utilities)
    • util.inherits
    • util.log
    • util.isArray
    • util.isDate
    • util.isError
  • require (function)
  • events
  • stream
    • stream.Readable
    • stream.Writebale
    • stream.Duplex
    • stream.Transform
    • NOTE! all the above inherit from Stream which you should not use directly.
    • NOTE! Stream inherits from EventEmitter

 

 

Requiring a module steps made by node

Then the follow is the logic followed by Node.js for a require('something') statement:

• If something is a core module, return it.
• If something is a relative path (starts with ‘./’ , ‘../’) return that file OR folder.
• If not, look for node_modules/filename or node_modules/foldername each level up until you
find a file OR folder that matches something.


When matching a file OR folder:, follow these steps:
• If it matched a file name, return it.
• If it matched a folder name and it has package.json with main, return that file.
• If it matched a folder name and it has an index file, return it.
 

Instruções

Para avançar no curso, envie uma tentativa deste quiz. Você pode enviá-la depois da última pergunta.

Ir para o módulo escolhido

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?