title: Exporting NestJs module vs Exporting Providers
body: <p>The NestJs allows exporting modules and providers. What is the difference between them?</p>
  <p>Example:</p>
  <pre><code>// Reusable module
  @Module({
  providers: [ServiceA],
  exports: [ServiceA]
  })
  class ModuleA {}
  
  </code></pre>
  <p>When and where should this module be exported? What does it help in?</p>
  <p>The NestJs documentation on <a href="https://docs.nestjs.com/modules" rel="nofollow noreferrer">modules</a> states the following...</p>
  <blockquote>
  <p>Now any module that imports the CatsModule has access to the CatsService and will share the same instance with all other modules that import it as well.</p>
  </blockquote>