You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, this is truly awesome code, very clearly written, and I hope to crib some of its style (if not substance) in other work I am doing.
Second, in the "browser" version, I see reference right up at the top to
require("color-convert")
and the like. I am of the opinion that require is a Node thing, not part of the JavaScript language. Is my impression wrong? If not, how does this work in a non-node setting? I don't see require() defined anywhere in the code.
Thanks again for writing this!
Walter
The text was updated successfully, but these errors were encountered:
You're right, require() is a built-in thing in node.js and not in the browser, but you can define your own require() function in the browser if you want. That's what the browserify module does. It takes all the modules in the directory, squashes them into one file and appends a require function definition. You can then use this file in the browser just as you would from node.
First off, this is truly awesome code, very clearly written, and I hope to crib some of its style (if not substance) in other work I am doing.
Second, in the "browser" version, I see reference right up at the top to
and the like. I am of the opinion that require is a Node thing, not part of the JavaScript language. Is my impression wrong? If not, how does this work in a non-node setting? I don't see require() defined anywhere in the code.
Thanks again for writing this!
Walter
The text was updated successfully, but these errors were encountered: