Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
Is it possible to use ES6 syntax on require() property?
Asked
Aug 24 '16 at 22:36
Active
Aug 24 '16 at 22:36
Viewed
30 times
0
Is it possible to use ES6 import instead of require?
var Promise = require('es6-promise').Promise;
ecmascript-6
asked Aug 24 '16 at 22:36
gotbahn
466
2
4
18
Have you already test ? Any error ?
–
Sylwit
Aug 24 '16 at 23:00
1
Did you search? [`[ecmascript-6] require to import`](https://stackoverflow.com/search?q=%5Becmascript-6%5D+require+to+import)
–
Felix Kling
Aug 25 '16 at 00:02
`import` means using ES6. ES6 means having `Promise` built in, so the example doesn't make sense.
–
a better oliver
Aug 25 '16 at 07:47
@zeroflagL say about it browsers that don't have Promise support. This is polyfill usage example.
–
gotbahn
Aug 25 '16 at 08:38
@FelixKling thx, exactly what I need
–
gotbahn
Aug 25 '16 at 08:39
0 Answers
0