index.js
function DiskStore(options) {
    options = options || {};

    this.options = extend({
        path: 'cache/',
        ttl: 60,
        maxsize: 0,
        zip: false
    }, options);


    // check storage directory for existence (or create it)
    if (!fs.existsSync(this.options.path)) {
        fs.mkdirSync(this.options.path);
    }

    this.name = 'diskstore';

    // current size of the cache
    this.currentsize = 0;

    // internal array for informations about the cached files - resists in memory
    this.collection = {};

    // fill the cache on startup with already existing files
    if (!options.preventfill) {

        this.intializefill(options.fillcallback);
    }
}
function DiskStore(options) {
    options = options || {};

    this.options = extend({
        path: 'cache/',
        ttl: 60,
        maxsize: 0,
        zip: false
    }, options);


    // check storage directory for existence (or create it)
    if (!fs.existsSync(this.options.path)) {
        fs.mkdirSync(this.options.path);
    }

    this.name = 'diskstore';

    // current size of the cache
    this.currentsize = 0;

    // internal array for informations about the cached files - resists in memory
    this.collection = {};

    // fill the cache on startup with already existing files
    if (!options.preventfill) {

        this.intializefill(options.fillcallback);
    }
}
function DiskStore ( options ) { options = options || { } ; this . options = extend ( { path : 'cache/' , ttl : 60 , maxsize : 0 , zip : false } , options ) ; // check storage directory for existence (or create it) if ( ! fs . existsSync ( this . options . path ) ) { fs . mkdirSync ( this . options . path ) ; } this . name = 'diskstore' ; // current size of the cache this . currentsize = 0 ; // internal array for informations about the cached files - resists in memory this . collection = { } ; // fill the cache on startup with already existing files if ( ! options . preventfill ) { this . intializefill ( options . fillcallback ) ; } }
construction of the disk storage
construction of the disk storage