2

Background

I'm trying to import the underscore library within coderpad.io (aka CoderPad)

This ES5 syntax works:

const _ = require('underscore')

This ES6 syntax doesn't:

import * as _ from 'underscore'

Question

Is it possible to use the ES6 import keyword in CoderPad? (if so, how? if not, why not?)

Atlas7
  • 2,446
  • 2
  • 24
  • 32

1 Answers1

2

From their Supported Languages page:

Running NodeJS v6

We run NodeJS with the --harmony flag on, which gives you access to most of the features in the upcoming JavaScript ES6 spec. For a complete description of which ES6 features are available, check out the Node compatibility table. Your code is also run for you in strict mode by default, which will enable most ES6 features to work without configuration on your part.

It uses Node v6, which implements most of ES6, but not modules.

sdgluck
  • 18,456
  • 4
  • 56
  • 83
  • 1
    Thank you for the reference to the other Stackoverflow forum - really helps! (good to know it's just a matter of timing / implementation schedule) – Atlas7 Sep 23 '16 at 15:22