首页 > 移动平台 > 详细

[Tools] Package Your node.js Projects Into a Standalone Applications with pkg

时间:2020-06-17 20:59:40      阅读:63      评论:0      收藏:0      [点我收藏+]

pkg allows you to take any of your node projects and bundle them up into standalone apps that you can ship to people or servers that do not have node.js installed. This lesson walks you through installing and using pkg on two simple projects.

 

Install:

npm i -g pkg

 https://www.npmjs.com/package/pkg

index.js:

console.log("hello world")

 

Run:

pkg index.js --target macos --output hello-wrold

 

It will output a bash file to run:

./hello-world

 

[Tools] Package Your node.js Projects Into a Standalone Applications with pkg

原文:https://www.cnblogs.com/Answer1215/p/13154495.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!