title: ES6 style imports in Node.js REPL
body: <p>Coming from a Python background and being new to Node.js, I've found it surprisingly difficult to interactively try code with Node.js REPL. One key problem that I have faced is with <code>imports</code>:</p>
  
  <p>ES6 style imports won't work on the Node.js REPL and I have to use CommonJS style imports using <code>require</code>. Example: I can't write <code>import rxjs</code> at the Node prompt and have to use <code>require('rxjs')</code>. This makes it harder to copy paste scripts into Node REPL to quickly test them and I have to first convert all ES6 style imports to require imports which feels counterintuitive.</p>
  
  <p>Is there any simple way to be able to use ES6 style imports from the Node.js REPL ?</p>
  
  <p>Like:</p>
  
  <blockquote>
    <p>$ node<br>
    > import 'rxjs';<br>
    > import {map} from 'rxjs/operator/map';</p>
  </blockquote>
  
  <p>I even tried <code>babel-node</code> which doesn't seem to support module imports.</p>