gpt4 book ai didi

javascript - JSPM ...从命令行运行节点应用程序,而不是通过 index.html?

转载 作者:行者123 更新时间:2023-11-29 15:36:25 27 4
gpt4 key购买 nike

我经常喜欢在命令行而不是在网络浏览器中使用 javascript 代码片段。

有没有办法让 JSPM 从命令行运行? SystemJS 关心它在哪里运行吗?

最佳答案

Is there a way with JSPM to run from the command line?

是的。

npm install -g jspm
jspm run <file>

Does SystemJS care about where it is being ran?

我不是很清楚你的意思。将 SystemJS 与 node.js 一起使用时,我们通常需要 JS 代码中的 SystemJS 模块,它不依赖于文件系统中的路径。

var System = require('systemjs');
System.import('foo').then(...);

关于javascript - JSPM ...从命令行运行节点应用程序,而不是通过 index.html?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28078806/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com