[Node.js] ファイルの拡張子を取得する path.extname
- 2014 4/21
- カテゴリー : Node.js
- Node.js . path.extname . 拡張子
- コメントを書く
Node.js の path module を使って、下記のようにファイルの拡張子を取得することができます。
path.extname('index.html') // returns '.html' path.extname('index.coffee.md') // returns '.md' path.extname('index.') // returns '.' path.extname('index') // returns '' |
参考情報
・Path Node.js v0.10.26 Manual & Documentation