How to use file-entry-cache - 9 common examples

To help you get started, we’ve selected a few file-entry-cache examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github miccferr / leaflet-store-locator / old / node_modules / eslint / lib / cli-engine.js View on Github external
/**
     * Stored options for this instance
     * @type {Object}
     */
    this.options = assign(Object.create(defaultOptions), options || {});


    var cacheFile = getCacheFile(this.options.cacheLocation || this.options.cacheFile);

    /**
     * cache used to not operate on files that haven't changed since last successful
     * execution (e.g. file passed with no errors and no warnings
     * @type {Object}
     */
    this._fileCache = fileEntryCache.create(cacheFile); // eslint-disable-line no-underscore-dangle

    if (!this.options.cache) {
        this._fileCache.destroy(); // eslint-disable-line no-underscore-dangle
    }

    // load in additional rules
    if (this.options.rulePaths) {
        this.options.rulePaths.forEach(function(rulesdir) {
            debug("Loading rules from " + rulesdir);
            rules.load(rulesdir);
        });
    }

    Object.keys(this.options.rules || {}).forEach(function(name) {
        validator.validateRuleOptions(name, this.options.rules[name], "CLI");
    }.bind(this));
github angelozerr / tern.java / core / ternjs / node_modules / tern-eslint / node_modules / eslint / lib / cli-engine.js View on Github external
options = lodash.assign(Object.create(null), defaultOptions, options);

    /**
     * Stored options for this instance
     * @type {Object}
     */
    this.options = options;

    var cacheFile = getCacheFile(this.options.cacheLocation || this.options.cacheFile, this.options.cwd);

    /**
     * cache used to not operate on files that haven't changed since last successful
     * execution (e.g. file passed with no errors and no warnings
     * @type {Object}
     */
    this._fileCache = fileEntryCache.create(cacheFile);

    if (!this.options.cache) {
        this._fileCache.destroy();
    }

    // load in additional rules
    if (this.options.rulePaths) {
        var cwd = this.options.cwd;
        this.options.rulePaths.forEach(function(rulesdir) {
            debug("Loading rules from " + rulesdir);
            rules.load(rulesdir, cwd);
        });
    }

    Object.keys(this.options.rules || {}).forEach(function(name) {
        validator.validateRuleOptions(name, this.options.rules[name], "CLI");
github FredHutch / Oncoscape / client / node_modules / eslint / lib / cli-engine.js View on Github external
/**
     * Stored options for this instance
     * @type {Object}
     */
    this.options = assign(Object.create(defaultOptions), options || {});


    var cacheFile = getCacheFile(this.options.cacheLocation || this.options.cacheFile);

    /**
     * cache used to not operate on files that haven't changed since last successful
     * execution (e.g. file passed with no errors and no warnings
     * @type {Object}
     */
    this._fileCache = fileEntryCache.create(cacheFile); // eslint-disable-line no-underscore-dangle

    if (!this.options.cache) {
        this._fileCache.destroy(); // eslint-disable-line no-underscore-dangle
    }

    // load in additional rules
    if (this.options.rulePaths) {
        this.options.rulePaths.forEach(function(rulesdir) {
            debug("Loading rules from " + rulesdir);
            rules.load(rulesdir);
        });
    }

    Object.keys(this.options.rules || {}).forEach(function(name) {
        validator.validateRuleOptions(name, this.options.rules[name], "CLI");
    }.bind(this));
github royriojas / persistify / index.js View on Github external
var depsCacheId = 'deps-cx-' + id;
  var cacheDir = opts.cacheDir;

  var flatCache = require( 'flat-cache' );
  var fileEntryCache = require( 'file-entry-cache' );

  if ( opts.recreate ) {
    flatCache.clearCacheById( id, cacheDir );
    flatCache.clearCacheById( depsCacheId, cacheDir );
  }
  // load the cache with id
  var cache = flatCache.load( id, cacheDir );

  // load the file entry cache with id, or create a new
  // one if the previous one doesn't exist
  var depsCacheFile = fileEntryCache.create( depsCacheId, cacheDir );

  var ignoreCache = false;

  // if the command was specified this can be used
  // as the cache buster
  if ( opts.command ) {
    var configHashPersisted = cache.getKey( 'configHash' );
    var hashOfConfig = hash( opts.command );

    ignoreCache = configHashPersisted !== hashOfConfig;

    if ( ignoreCache ) {
      cache.setKey( 'configHash', hashOfConfig );
    }
  }
github elastic / timelion / node_modules / gulp-eslint / node_modules / eslint / lib / cli-engine.js View on Github external
/**
     * Stored options for this instance
     * @type {Object}
     */
    this.options = assign(Object.create(defaultOptions), options || {});


    var cacheFile = getCacheFile(this.options.cacheLocation || this.options.cacheFile);

    /**
     * cache used to not operate on files that haven't changed since last successful
     * execution (e.g. file passed with no errors and no warnings
     * @type {Object}
     */
    this._fileCache = fileEntryCache.create(cacheFile); // eslint-disable-line no-underscore-dangle

    if (!this.options.cache) {
        this._fileCache.destroy(); // eslint-disable-line no-underscore-dangle
    }

    // load in additional rules
    if (this.options.rulePaths) {
        this.options.rulePaths.forEach(function(rulesdir) {
            debug("Loading rules from " + rulesdir);
            rules.load(rulesdir);
        });
    }

    Object.keys(this.options.rules || {}).forEach(function(name) {
        validator.validateRuleOptions(name, this.options.rules[name], "CLI");
    }.bind(this));
github DesTincT / bemlint / lib / cli-engine.js View on Github external
options = lodash.assign(Object.create(null), defaultOptions, options);

    /**
     * Stored options for this instance
     * @type {Object}
     */
    this.options = options;

    var cacheFile = getCacheFile(this.options.cacheLocation || this.options.cacheFile, this.options.cwd);

    /**
     * cache used to not operate on files that haven't changed since last successful
     * execution (e.g. file passed with no errors and no warnings
     * @type {Object}
     */
    this._fileCache = fileEntryCache.create(cacheFile);

    if (!this.options.cache) {
        this._fileCache.destroy();
    }

}
github eslint / eslint / lib / cli-engine / lint-result-cache.js View on Github external
constructor(cacheFileLocation) {
        assert(cacheFileLocation, "Cache file location is required");

        this.fileEntryCache = fileEntryCache.create(cacheFileLocation);
    }
github stylelint / stylelint / lib / utils / FileCache.js View on Github external
function FileCache(cacheLocation, hashOfConfig) {
	const cacheFile = path.resolve(
		getCacheFile(cacheLocation || DEFAULT_CACHE_LOCATION, process.cwd()),
	);

	debug(`Cache file is created at ${cacheFile}`);
	this._fileCache = fileEntryCache.create(cacheFile);
	this._hashOfConfig = hashOfConfig || DEFAULT_HASH;
}
github textlint / textlint / packages / textlint / src / engine / execute-file-backers / cache-backer.ts View on Github external
constructor(public config: Config) {
        /**
         * @type {boolean}
         */
        this.isEnabled = config.cache;
        this.fileCache = fileEntryCache.create(config.cacheLocation);
    }

file-entry-cache

A lightweight cache for file metadata, ideal for processes that work on a specific set of files and only need to reprocess files that have changed since the last run

MIT
Latest version published 27 days ago

Package Health Score

91 / 100
Full package analysis

Popular file-entry-cache functions