Category "require"

requiring a directory rather than a js file

I come across a piece code like this in an index.js file: exports = module.exports = require("./src") Not sure what the exports = module.exports bit means. And

How to use peerjs (import and require both fail)

I want to use peerjs in a script (that I use in a html file). When I try import Peer from "peerjs", I get an error saying "Cannot use import statement outside a

How to dynamically render a markdown file in Angular?

I'm trying to write an Angular component that renders markdown files as part of the webpage, using the ngx-markdown library. Looking at the library's official

Node js require code instead of file

I am trying to setup an interface, where I can write one js file that can be used on the server (nodejs) and on the client (javascript). An example file would

How to "require(module)" in mongo shell

I am writing a mongo shell script for data management. I want to write it using modular code that makes use of function libraries as modules. In some cases, m