如何在VSCode中运行Pipescript代码?

huangapple go评论55阅读模式
英文:

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

huangapple
  • 本文由 发表于 2023年6月12日 19:39:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76456298.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定