简体   繁体   中英

How to invoke a node.js script in TypeScript / JavaScript?

I have a node.js script under /bin folder. The script is a command line tool that generates png files. I use it as $ node vl2png [input_file_name] [output_file_name]

I have a gallery.ts file which will populate an online gallery. I want to use the pngs generated by the vl2png script in my gallery. What's the best way to call the node script in my gallery.ts file?

您可以编译gallery.ts以获得gallery.js ,然后使用node运行它,也可以安装ts-node并运行ts-node gallery.ts

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM