我刚刚开始使用Node-webkit,并认为它很棒.
我使用“Web sql数据库”选项mentioned here设置了一个数据库,它似乎运行良好.很像sqlite,我对它很熟悉.
从文档中,这是使用sqlite实现的,所以我希望能够找到这个在磁盘上创建的实际db文件,并使用sqlite编辑器(如sqliteman)查看它.
db文件保存在哪里?
我无法在文档中找到它,或通过谷歌搜索它;-)
解决方法
从node-webkit版本0.6.1开始,您可以从App对象中检索dataPath. Websql文件将存储在数据库文件夹中.
维基:https://github.com/rogerwang/node-webkit/wiki/App
Get the application’s data path in user’s directory.
Windows: %LOCALAPPDATA%/;
Linux: ~/.config/;
OSX: ~/Library/Application Support/ where is the field in the manifest.
例:
require('nw.gui').App.dataPath;