hoast-changed
v1.1.3
Published
Hoast module used filter out files which have not been changed since the last build.
Downloads
21
Readme
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 totrue
.
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
- Type:
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
orArray of strings
- Required:
no
- Type:
patternOptions
: Options for the glob pattern matching. See planckmatch options for more details on the pattern options.- Type:
Object
- Default:
{}
- Type:
patternOptions.all
: This options is added topatternOptions
, and determines whether all patterns need to match instead of only one.- Type:
Boolean
- Default:
false
- Type:
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.