I was analyzing javascript codes in a chrome extension and noticed this in it.
require("name of required class/file/module") //Not sure whether it is class,file,module
May be its because I'm newbie to programming or something,but I cant find the 'require' keyword in javascript reference or documentation.There is 'import' statement for importing modules. I googled for require for javascript but all I can find is the 'require' for node.js, the server side scripting using javascript. I am talking about chrome extension/client side script.Does anyone have any idea about this ?
require()isn't a keyword. It's a function defined either by the environment (Node.js), a library (e.g. RequireJS), or a build tool (e.g., Browserify). AMD and CommonJS are the common standards related torequire(), each defining it differently. (The snippet appears to follow CommonJS-style.)