3 ms·
Won't this make leftpad-type scenarios even _more_ likely? What is the benefit?
by royjacobs 5y ago
Won't this make leftpad-type scenarios even _more_ likely? What is the benefit?
- zja 5y agoIf node shares import syntax with browsers, it’s easier to write code that runs on both platforms. As far as leftpad, this isn’t that much different from using a package manager. You either cache your dependencies, or rely on a third party (npm repo/cdn).
- onion2k 5y agoWhen leftpad was in NPM there was an expectation that it wouldn't disappear suddenly. Package registries are thought to be a constant, reliable source of packages (even when they not quite that, as leftpad demonstrated). There would be no such expectation for a module that you include directly from an https URL. The main benefit I can see is that you can include code from your own "registry" very easily in unmanaged scripts. You can already do that because you can add a dependency to package.json using an https link already, but with this new feature you can include those dependencies in node scripts you aren't managing with a package file. You can do that. I'm not suggesting you should. I won't.