title: How to Detect USB device connected using Node.js
body: <p>I am newbie to Node.js. I would like to detect if any USB / Mass storage device is connected to the system.</p>
  
  <p>As we have something in C# to do like</p>
  
  <pre><code>// Add USB plugged event watching
          watcherAttach = new ManagementEventWatcher();
          watcherAttach.EventArrived += watcherAttach_EventArrived;
          watcherAttach.Query = new WqlEventQuery("SELECT * FROM  Win32_DeviceChangeEvent WHERE EventType = 2");
          watcherAttach.Start();
  
          // Add USB unplugged event watching
          watcherDetach = new ManagementEventWatcher();
          watcherDetach.EventArrived += watcherDetach_EventArrived;
          watcherDetach.Query = new WqlEventQuery("SELECT * FROM Win32_DeviceChangeEvent WHERE EventType = 3");
          watcherDetach.Start();
  </code></pre>
  
  <p>Please suggest how we can do something similar of C# in Node.js.</p>