Eric
Eric

Reputation: 3231

Is module.exports unique to node.js

I'm stepping through some client-side JavaScript code that code like:

       (function() {
            'use strict';
            debugger; //TODO
            module.exports = function(utils, e) 

Called by:

return require(name, dirname(path));

Does this mean that it's using node.js? This is client-side code that's using Backbone and JQuery.

-Eric

Upvotes: 0

Views: 55

Answers (1)

SLaks
SLaks

Reputation: 887797

No.

This pattern is called CommonJS Modules; Node.js merely implemenets the pattern.

There are a number of implementations that run in the browser; Browserify is the most popular.

Upvotes: 3

Related Questions