0

I have an external library which needs to be integrated in node.js. I tried the following

In my js file, i have included the library as

var epson = require('./epos-print.js');

and i tried creating the object as

var builder = new epson.ePOSBuilder();

which is in my current directory. I get the error as "module not found". Which means i am failing in first step itself. Is there any other settings required to create an object of my library file.

My library file has like this

(function(window, undefined) {
    function ePOSBuilder() {
    .
    .
    .
    .
    }
.
.
.
.
.

})(window);

Tried following ways in the library file.

exports.ePOSBuilder = function ePOSBuilder() {

}

AND

module.exports = exports = function ePOSBuilder() {
}

AND

tried with permission 775 as well.

Still it says. Module not found.

4

0 回答 0