4 ms·
Isn't this exactly what CommonJS does/did?
by ricardobeat 4y ago
Isn't this exactly what CommonJS does/did?
- capableweb 4y agoNo, you're thinking of `destructuring`. CommonJS was "just" a common format for defining/importing modules in a NodeJS environment (via `module.exports` and `require`), eventually being used for packaging frontend "applications" as well, popularized by Browserify. To expand, the following was common before destructuring but with CommonJS: var some_func= require('some_module').some_func Which, as you know, would probably usually be done like this today, where we have destructuring: let {some_func} = require('some_module')