Closed rudra0713 closed 7 years ago
The Readium JavaScript code is written using AMD (Asynchronous Module Definitions), not Node CommonJS.
Furthermore, this is JavaScript for web browser runtime, not NodeJS / server environment (different set of APIs / libraries).
Let's say I have a javascript file named EpubReader.js inside my src directory and I want to use an already installed node module package (ex : require-dir, lodash etc) in my js file. What is the appropriate way to do this ? I have been trying something like this -
var dir = require("require-dir") and I received this error "no require-dir" . Although it is installed in my node module directory. But, if I copy this simple line in a sample index.js file and run it using node command, it works without any error.