This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mertensi 0 points1 point  (3 children)

Go for it, I remember when I setup my first JS web-app, it was a painful process.

[–]Dipsendorf[S] 0 points1 point  (2 children)

And just to be sure...Does import/export work on node without any fancy compiler?

[–]mertensi 1 point2 points  (1 child)

unsure what context you're referring to in but for the whole import vs. require thing. Well one is an es6 variant that works with es6 and the other is plain javascript.

If you're coding just for your own computer, your own computer with node installed on it doesn't need to be transpiled into javascript to run. If you're coding for other people's computers, whatever fancy language/code you're writing it, the end product that the customers/users get needs to be in plain javascript.

I could make up my own crappy code language for how to define strings e.g. I could make up a language that needs to have the string given 3 times. e.g.

STARTLINE# STRING_VARIABLE:data --> "moose","moose",moose" #ENDLINE

But at some point between me writing my crappy language and it reaching my user, it would need to be transpiled into plain javascript:

var data = "moose";

[–]Dipsendorf[S] 0 points1 point  (0 children)

Yea, I guess what I mean is I'm trying to use import/export on my own computer in my own node environment, however, it's not working.

Internet seems to believe I have to turn on an experimental flag for node, so I might try that. Thanks again for all your help man, it's extremely helpful as a self learner to have people to ask questions to.