Closed michaelBenin closed 9 years ago
Is it because the package.json main's property?
https://github.com/defunctzombie/num/blob/master/package.json#L17
This is the expected behavior. It keeps you compatible with the ES6 import syntax used everywhere in ember-cli. You'll notice that every other dependency behaves the same way (try require('ember')
in the console).
Instead of writing this:
var myThing = require('npm:my-thing');
write this:
import myThing from 'npm:my-thing';
And the ES6 transpiler will do the right thing for you.
Ah ok, I was debugging with a debugger statement and using the imported library.
I see what you are saying now. Thank you.
Library we are importing:
https://github.com/defunctzombie/num/blob/master/num.js
Import code:
Returns an object:
{ default: function }
Is there a way to import this where num is a function and not an object?