Skip to content

Commit

Permalink
REF: Remove unused read-json-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
nopnop committed Jul 28, 2016
1 parent c31081e commit 2be1c24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
11 changes: 4 additions & 7 deletions cache.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
var path = require( 'path' );
var fs = require( 'graceful-fs' );
var write = require( 'write' );
var del = require( 'del' ).sync;
var circularJson = require( 'circular-json' );

var fileCache = { };
var readJSON = require( './utils' ).readJSON;
var writeJSON = require( './utils' ).writeJSON;

var cache = {
/**
Expand All @@ -24,8 +22,7 @@ var cache = {
me._pathToFile = cacheDir ? path.resolve( cacheDir, docId ) : path.resolve( __dirname, './.cache/', docId );

if ( fs.existsSync( me._pathToFile ) ) {
me._persisted = fileCache[ me._pathToFile ] || circularJson.parse( fs.readFileSync( me._pathToFile ).toString() );
fileCache[ me._pathToFile ] = me._persisted;
me._persisted = readJSON( me._pathToFile );
}
},

Expand Down Expand Up @@ -109,7 +106,7 @@ var cache = {
var me = this;

me._prune();
write.sync( me._pathToFile, circularJson.stringify( me._persisted ) );
writeJSON( me._pathToFile, me._persisted );
},

/**
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"circular-json": "^0.3.0",
"del": "^2.0.2",
"graceful-fs": "^4.1.2",
"read-json-sync": "^1.1.0",
"write": "^0.2.1"
}
}

0 comments on commit 2be1c24

Please sign in to comment.