Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

Latest commit

 

History

History
77 lines (56 loc) · 2.78 KB

README.md

File metadata and controls

77 lines (56 loc) · 2.78 KB

npm package @latest npm package @next

Travis-ci status CodeCov coverage

License agreement Open issues on GitHub

hoast-changed

Filter out files which have not been changed since the last build.

As the name suggest this is a hoast module.

Do note this module can only be used if remove property of the hoast options is NOT set to true.

Usage

Install hoast-changed using npm.

$ npm install hoast-changed

Parameters

  • file: The file path where the update times are stored.
    • Type: String
    • Default: hoast-changed
  • patterns: Glob patterns to match file paths with. If the file path matches the patterns it will be skipped and continue to be processed.
    • Type: String or Array of strings
    • Required: no
  • patternOptions: Options for the glob pattern matching. See planckmatch options for more details on the pattern options.
    • Type: Object
    • Default: {}
  • patternOptions.all: This options is added to patternOptions, and determines whether all patterns need to match instead of only one.
    • Type: Boolean
    • Default: false

Example

CLI

{
  "modules": {
    "hoast-changed": {
      "patterns": "*/index.md"
    },
    "read": {}
  }
}

All the files will be checked for their changed time except the index.md files which will always be processed.

Script

const Hoast = require(`hoast`);
const read = Hoast.read,
      changed = require(`hoast-changed`);

Hoast(__dirname)
  .use(changed({
    patterns: `*/index.md`
  }))
  .use(read())
  .process();

All the files will be checked for their changed time except the index.md files which will always be processed.