Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

我編譯故我在:誰說 Node.js 程式不能編成 binary

17,783 views

Published on

Published in: Technology, Self Improvement
  • Be the first to comment

我編譯故我在:誰說 Node.js 程式不能編成 binary

  1. 1. 我編譯故我在誰說 Node.js 程式不能編成 BinaryFred Chien
  2. 2. 錢逢祥Fred Chien
  3. 3. Mandice
  4. 4. cfsghost At gmail.com
  5. 5. fred-zone.blogspot.com
  6. 6. StemWonderful JavaScript OSstem.mandice.org
  7. 7. "You do Everything." customer said.客戶一向說我是萬能的
  8. 8. But但
  9. 9. Hard to get paid for Everything從他們口袋裡多拿錢卻萬萬不能
  10. 10. One day某天
  11. 11. More requests are coming客戶又要追加一堆免錢功能
  12. 12. Fucx很 X
  13. 13. Do It於是我決定
  14. 14. At night做完那天晚上
  15. 15. Be Strong硬起來
  16. 16. Only 72 hours for getting paid給自己 72 小時通諜的勇氣
  17. 17. Damn It !但是
  18. 18. The Next Day第二天
  19. 19. Customer goes abroad客戶就出國去了
  20. 20. And Ignore me直接忽略了我的請款
  21. 21. oops!@#$%^&*
  22. 22. Assert ourself悍衛主權啦!
  23. 23. So於是
  24. 24. Do some hacks我把軍艦開到他家
  25. 25. Hide everything把程式碼都藏起來
  26. 26. The Next Morning第二天早上
  27. 27. Customers surrendered themself客戶立馬從國外打電話回來說要付錢
  28. 28. Customers surrendered themself還派他的特使小姐來收我的發票
  29. 29. in 72 hours72 小時的成果
  30. 30. Node.js Packaging UtilityNPK
  31. 31. Node.js 程式碼封裝工具NPK
  32. 32. https://github.com/cfsghost/npknpk at Github
  33. 33. npm install npk -gInstall via NPM
  34. 34. Obfuscation面目全非
  35. 35. Compress and Minify壓縮
  36. 36. Bundle all in single file封裝成單一檔案
  37. 37. Compile it to binary file編譯成二進位檔
  38. 38. The point is最酷的是
  39. 39. Supported 3 levelsNPK 支援三種封裝等級
  40. 40. Remove mock-up卸了妝 認不得
  41. 41. Your Mom doesnt recognize媽媽不認得
  42. 42. Your Dad doesnt recognize as well爸爸也不認得
  43. 43. So所以
  44. 44. It make sense這樣的設計應該很合理
  45. 45. $ npk . --remove-mockup$ npk . --mom-doesnt-recognize$ npk . --dad-doesnt-recognize
  46. 46. Trying to explain these levels簡單來說
  47. 47. 縮排脫掉,變數脫掉,空白脫掉,通通脫掉卸了妝
  48. 48. 加密壓縮程式碼媽都不認得
  49. 49. 用 Compiler 編譯成 Binary爸也不認得
  50. 50. Workflowjs filejs filejs filejs fileGenerate Symbol Tableand Object filesLink all to generatefinal package file
  51. 51. Package your Node.js code打包你的 Node.js 程式
  52. 52. Modify package.json for NPK修改 package.json
  53. 53. {"name": "example-project","desciption": "Example program","version": "0.0.1","npk_target": {"app.js": {"sources": ["app.js","lib/a.js","lib/b.js"]}}}Modifying package.json
  54. 54. Pack Now!開始打包!
  55. 55. npk /home/fred/myprojectnpk [project path]可以配合服用爸媽不認得參數
  56. 56. 你將會得到out/app.js/app.js
  57. 57. Where is the thing dad doesnt recognize?爸不認得的Code在哪?
  58. 58. out/app.js/build/Release/npk.node
  59. 59. :-)Live Demo
  60. 60. You might ask what ...你可能最想問的是
  61. 61. Is it reliable to protect our code?NPK 真的靠的住嗎?
  62. 62. Absolutely No靠不住
  63. 63. Gentleman should not steal code防君子
  64. 64. Customer should pay for code防客戶
  65. 65. Somebody is evil但是最怕
  66. 66. Source code is still there失傳的還我漂漂拳
  67. 67. Whats Next?
  68. 68. Encryption, LLVM... etc
  69. 69. 歡迎命名投搞也許有下一個封裝等級?
  70. 70. Welcome to punch my face打臉時間
  71. 71. Advertisement最後宣傳一下
  72. 72. StemWonderful JavaScript OSstem.mandice.org
  73. 73. 需要 JS 開發者的幫忙!Wanted You
  74. 74. JavaScript 硬起來!
  75. 75. 歡迎跟我聯繫或交換名片 :-)cfsghost At gmail.com
  76. 76. Thanks

×