There is "Require once" in Javascript / Jquery

0

I made a class in JS (Model ES6), it's working beauty, but how do I put it in an external file and give it a Require Once as in PHP? Can you do that? Thanks;)

    
asked by anonymous 25.04.2017 / 18:28

1 answer

0

It depends on your environment, if you use jQuery in the webbrowser (for a website, for example), you can take a look at the plugins like browserify which make about the require model of the NodeJS.

If you are using the Node environment, then just use require itself, but I do not believe there is a require_once , even because objects are stored in variables, they are not embedded in the environment. >     

25.04.2017 / 18:35