英文:
How can I run a Pipescript code in VSCode?
问题
我已经在我的Mac上安装了Pipescript语言的2.1版本。
我在VSCode中创建了一个小的Pipescript代码(.pps文件):
depends http
depends json
#skip_on_error
val temperature = http::get("api.weather.com/temperature")
if temperature > 30
val adjustedTemp = temperature - 5
val result = adjustedTemp * 2
output::println("Final result: " + result)
else
output::println("Not Temperature enough for calculations.")
end
现在我已经在VSCode中安装了Pipescript扩展,但我不知道如何运行它。有任何帮助吗?
英文:
I have installed on my Mac the Pipescript language 2.1 version.
I have created a small Pipescript code (.pps file) in VSCode :
depends http
depends json
#skip_on_error
val temperature = http::get("api.weather.com/temperature")
if temperature > 30
val adjustedTemp = temperature - 5
val result = adjustedTemp * 2
output::println("Final result: " + result)
else
output::println("Not Temperature enough for calculations.")
end
Now I have installed the Pipescript extension in VSCode but I don't know how to run it.Any help ?
答案1
得分: 2
你只需要使用 npm init
创建一个包,然后安装 Nodemon:
npm install nodemon
Nodemon 是一个工具,通过在检测到目录中的文件更改时自动重新启动 Node.js 应用程序,帮助开发基于 Node.js 的应用程序。
现在只需将此行添加到你的 package.json 文件中的 script 对象中:
"dev": "nodemon file_name.pps"
这将在每次运行
npm run dev
并继续跟踪更改时执行 "file_name.pps" 文件。
英文:
You just have to create a package using npm init
then install Nodemon:
npm install nodemon
>nodemon is a tool that helps develop Node.js based applications by automatically restarting the node application when file changes in the directory are detected.
Now just add this line inside the script object in your package.json file:
"dev": "nodemon file_name.pps"
This will execute the "file_name.pps" file each time you run
npm run dev
and keep tracking changes
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论