Friday, 6 September 2013

Reference error : epson node js

Reference error : epson node js

I am new to node.js, i have a requirement of calling epson api's. Which
works fine when used with javascript, outside node.js. The code is simple,
just call the js file of there's and create a object and build the data
out of it. There is no other dependency required.
Ex :
<script type="text/javascript" src="js/epos-print-3.0.0.js"></script>
var builder = new epson.ePOSBuilder();
Doing above works fine in general like calling those js file and using.
So, for the same in node.js, i added the js file and i see the js file
being included in the page but still i get the following error.
ReferenceError: epson is not defined
at printReceipt (cart:729:21)
at cart:329:13
at cart:693:9
at Request._callback (cart:716:5)
at Request.self.callback
(/home/admin1/git/presentation/node_modules/request/index.js:148:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request.<anonymous>
(/home/admin1/git/presentation/node_modules/request/index.js:876:14)
..
..
..
Is there any specific way of creating a 3rd party api object in node.js ??.
Any help, appreciated !!!

No comments:

Post a Comment