[英]How to invoke a node.js script in TypeScript / JavaScript?
I have a node.js
script under /bin
folder. 我在
/bin
文件夹下有一个node.js
脚本。 The script is a command line tool that generates png
files. 该脚本是生成
png
文件的命令行工具。 I use it as $ node vl2png [input_file_name] [output_file_name]
我将其用作
$ node vl2png [input_file_name] [output_file_name]
I have a gallery.ts
file which will populate an online gallery. 我有一个
gallery.ts
文件,它将填充在线画廊。 I want to use the pngs
generated by the vl2png
script in my gallery. 我想使用
pngs
的vl2png
脚本生成的vl2png
。 What's the best way to call the node script in my gallery.ts
file? 在
gallery.ts
文件中调用节点脚本的最佳方法是什么?
您可以编译gallery.ts
以获得gallery.js
,然后使用node
运行它,也可以安装ts-node并运行ts-node gallery.ts
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.