How to import / use node module package inside src/js file
rudra0713 opened this issue · 1 comments
rudra0713 commented
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.
danielweck commented
Duplicate: readium/readium-js-viewer#638 (comment)