mirror of
https://github.com/amark/gun.git
synced 2025-06-06 14:16:44 +00:00
Merge pull request #191 from PsychoLlama/develop
Make `data.json` human-readable
This commit is contained in:
commit
25e7579d13
@ -25,7 +25,8 @@ Gun.on('opt').event(function(gun, opts) {
|
||||
function writeFile(cb) {
|
||||
if(isWriting) return queuedWrites.push(cb);
|
||||
isWriting = true;
|
||||
fs.writeFile(opts.file, Gun.text.ify(all), function(err) {
|
||||
var contents = JSON.stringify(all, null, 2);
|
||||
fs.writeFile(opts.file, contents, function(err) {
|
||||
var batch = queuedWrites.splice(0);
|
||||
isWriting = false;
|
||||
cb(err);
|
||||
|
@ -1,6 +1,5 @@
|
||||
;(function(wsp){
|
||||
var Gun = require('../gun')
|
||||
, formidable = require('formidable')
|
||||
, ws = require('ws').Server
|
||||
, http = require('./http')
|
||||
, url = require('url');
|
||||
|
Loading…
x
Reference in New Issue
Block a user