亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

node-webkit 如何獲取當前路徑?

node-webkit 如何獲取當前路徑?

梵蒂岡之花 2018-06-27 14:14:40
當node-webkit的應用運行時,會在臨時目錄里邊產生一些臨時文件,node-webkit就是在這個臨時目錄里邊運行的,那么如何獲取程序的真實路徑?
查看完整描述

1 回答

?
明月笑刀無情

TA貢獻1828條經驗 獲得超4個贊

I want to build some data on the current directory ? But how to get the current directory?
console.log(__dirname)
I try that, but it doesn't work.
I want a little help.
Some temp files were built in the temp directory when it work on. How to get the real dirname?

answer:

Just so you know your project is compressed, packed, and concatenated into the binary. So when it runs it will unpack to a temp directory in order to be accessed.

Get path of project directory (temp dir):

console.log(process.cwd());

Get path of project binary:

var path = require("path");console.log(path.dirname(process.execPath));


查看完整回答
反對 回復 2018-07-08
  • 1 回答
  • 0 關注
  • 401 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號