Monday, 5 June 2017

Trying to debug a node module, completely confused on how to 'require' it into my script

Hi everyone, js noob here. i'm trying to debug Quill.js's fantastic Delta library but I'm incredibly confused by the all the terminology and different technologies available. I've spent a few hours searching Stackoverflow, but more and more terminology is introduced and the stack only ends up deeper.Basically, all I want to do is the following:Have a script called "index.js"Load the Delta library and all its dependenciesCreate a new Delta object, defined in the Delta library (var myDelta = new Delta())Call functions on it (myDelta.insert('hello world!'))Right now, I've done the following:Installed npmRun 'npm init'Run 'npm install quill-delta'Created an index.js filerequire('quill-delta') in the index.js fileran 'node index.js'I'm basically stuck after this, though. After the require('quill-delta') line, everytime I try to create a new Delta object, I get "ReferenceError: Delta is not defined," so clearly the Delta library isn't being loaded into my file.Any help is much appreciated!

Submitted June 06, 2017 at 01:28AM by dakmau

No comments:

Post a Comment