• Yiyu's Dev Blog
  • ABOUT
  • ARCHIVES
  • RSS
Search ...
Search ...

Tag: nodejs

Tags

| 2019-07-01

[nodejs] module.exports 與 exports 的差異

前言nodejs 中有許多的特性或是方便的功能我們會使用,但實際上不知道內部處理的機制。本篇要探討的是匯出模組的兩種方式 modules.exports 以及 exports 結論(TL;DR) The exports variable is available within a module’s file-level scope, and is assigned the value of module.exports before the module is evaluat ...

yiyu0x
yiyu0x
2 min read
| 2019-05-19

nodeJS 中的 fs module 介紹

前言在學習任何一個語言一定都會遇到檔案讀寫,在 nodeJS 中的檔案讀寫幾乎都能透過 fs 這個 module 來完成。 而且在 fs API 中有這麼一段話 All file system operations have synchronous and asynchronous forms. 對於開發者來說實在是非常棒,不像有些 module 同步與異步是分開成兩個不同的 module。 常用操作讀取文件以下要注意第二個參數要指定編碼,否則印出來會是 raw data 的 ...

yiyu0x
yiyu0x
3 min read
— Yiyu's Dev Blog —

Recent Posts

  • 2025 Life Update
  • EKS ELB 獲取 Client IP 方法紀錄
  • 建立 Reliable EKS 記錄
MORE →

Tag Cloud

AWS CI/CD DNS Docker DroneCI EKS ELB Kubernetes Linux c cgroup container ctf docker es6 fp http2 javascript kubernetes life linux macOS macos mysql nginx nodejs oauth2 podman python raspberry_pi shell socket telegram tools traefik 個人 資訊安全
Yiyu's Dev Blog
Yiyu's Dev Blog © 2025
皖ICP备17018037号 Hexo GeekMubai