[英]how to download a js file from a server and run it?
Is it possible to run a js file locally that downloads a secondary file and then run the latter?是否可以在本地运行下载辅助文件然后运行后者的js文件?
I know the best thing would be to download the file from the server and save it locally, I would just like to understand if there is still the possibility to do the above.我知道最好的办法是从服务器下载文件并将其保存在本地,我想了解是否仍有可能执行上述操作。
Example:例子:
Open terminal打开终端
1- node index js 1-节点索引js
2 - download scripts js in the same directory as index.js 2 - 下载与 index.js 相同目录下的脚本 js
3 - download is complete, start script js automatically. 3 - 下载完成,自动启动脚本js。
Even if it is possible to solve it with Node.js workarounds (like requireing your puppeteer script from an url etc.) I strongly suggest to use Git with your team to share the latest version of your script.即使可以使用 Node.js 解决方法来解决它(例如从 url 等中要求您的 puppeteer 脚本),我强烈建议您使用Z0BCC70105AD279503E31FE7B3F47B6Z的最新版本与您的团队共享脚本。 Version control is a must in modern software development, especially if you are working in a team.
在现代软件开发中,版本控制是必须的,尤其是在团队工作的情况下。 By learning the 6-7 most basic git commands you can solve almost everything you need for the current use case.
通过学习 6-7 个最基本的 git 命令,您几乎可以解决当前用例所需的一切。
There are many good tutorials how to get started with git, I recommend GitHub's https://try.github.io . There are many good tutorials how to get started with git, I recommend GitHub's https://try.github.io .
Of course: you need to convince your team to embrace the change, or in better case they are already using it for version control, so it will be familiar to them.当然:您需要说服您的团队接受更改,或者在更好的情况下,他们已经将其用于版本控制,因此他们会很熟悉。
Git can be frightening at first sight, but it can be learned in a few days and it makes code sharing smooth within your team. Git 乍一看可能很吓人,但几天内就可以学会,它使您的团队内部的代码共享变得顺畅。
One of Git's tagline describes very well why it will solve your problem: Git 的标语之一很好地描述了它为什么会解决您的问题:
--everything-is-local
--一切都是本地的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.