But at least I can just download a .py file (or a bunch of files) and just import them. Perhaps the biggest frustration/pain point in this article isn't npm as such, but that you can't "just" use some JS module.
Nothing would stop you from doing that (import thing from ‘./downloaded.js’) but it’s Just Not Done That Way and packages aren’t really built with that in mind, so it probably wouldn’t work very well in practice.
You definitely can. On the server side, you can literally do that. On the client side, you can "import" one with a script tag, and increasingly you can use modules in browsers too.
Just importing doesn't seem to work for millions of people:
- https://stackoverflow.com/questions/4383571/importing-files-... (1.5m views)
- https://stackoverflow.com/questions/14132789/relative-import... (215k views)
- https://stackoverflow.com/questions/72852/how-to-do-relative... (325k views)
- https://stackoverflow.com/questions/1918539/can-anyone-expla... (100k views)
- https://stackoverflow.com/questions/1260792/import-a-file-fr... (480k views)
- https://stackoverflow.com/questions/7505988/importing-from-a... (136k views)
- https://stackoverflow.com/questions/9252543/importerror-cann... (700k views)
- https://stackoverflow.com/questions/2325923/how-to-fix-impor... (430k views)
- https://stackoverflow.com/questions/15514593/importerror-no-... (250k views)