title: how to import node npm module in angular 6
body: <p>I have installed the package</p>
  
  <pre><code>npm install local-devices
  </code></pre>
  
  <p>and imported it in <code>angular.json</code> as </p>
  
  <pre><code>"scripts": [
      "./node_modules/local-devices/index.js"
  ]
  </code></pre>
  
  <p>and declared as <code>global variable</code> in <code>src/typings.d.ts</code></p>
  
  <pre><code>declare let findLocalDevices: any
  </code></pre>
  
  <p>Below, <code>package</code> files structure and <code>index.js</code> of <code>local-devices</code> package</p>
  
  <p><a href="https://i.stack.imgur.com/McsLz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/McsLz.png" alt="enter image description here"></a><a href="https://i.stack.imgur.com/hXl9Z.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hXl9Z.png" alt="enter image description here"></a></p>
  
  <p>then tried to use it in a component as </p>
  
  <pre><code>console.log(findLocalDevices())
  </code></pre>
  
  <p>but got error</p>
  
  <blockquote>
    <p>findLocalDevices is not defined</p>
  </blockquote>
  
  <p>How to import it, please guide!!!</p>