Node.js levelDB未保存在本地存储中

Node.js levelDB未保存在本地存储中,node.js,database,electron,leveldb,leveldown,Node.js,Database,Electron,Leveldb,Leveldown,我为工作的levelDb数据库安装了levelnpm 但效果不好,只需在浏览器中保存即可 相似图像 我想把数据保存在文件中 这是我的密码 // 1) Create our database, supply location and options. // This will create or open the underlying store. var db = level('./db', { valueEncoding: 'json' }) // 2) Put a key &am

我为工作的levelDb数据库安装了levelnpm

但效果不好,只需在浏览器中保存即可 相似图像

我想把数据保存在文件中

这是我的密码

// 1) Create our database, supply location and options.
//    This will create or open the underlying store.
var db = level('./db', { valueEncoding: 'json' })

// 2) Put a key & value
db.put('name', { name: 'Level', ab: 'hhhhh' }, function (err) {
  if (err) return console.log('Ooops!', err) // some kind of I/O error
})

// 3) Fetch by key
      db.get('name', function (err, value) {
        if (err) return console.log('Ooops!', err) // likely the key was not found
        // Ta da!
        console.log('name= ' + value.ab)
      })
多谢各位