diff --git a/lib/index.d.ts b/lib/index.d.ts index 71ca151..a0df8a1 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -7,6 +7,12 @@ export type Options = { /** * A Metalsmith plugin to remove files from the build + * + * @example + * // remove all dotfiles that are direct children of metalsmith.source() + * metalsmith.use(remove('.*')) + * // remove all JSON files + * metalsmith.use(remove(['**\/*.json'])) */ declare function remove( /** One or more [glob patterns](https://en.wikipedia.org/wiki/Glob_(programming)) */ diff --git a/src/index.js b/src/index.js index aca325f..e55ddf2 100644 --- a/src/index.js +++ b/src/index.js @@ -22,6 +22,11 @@ function normalizeOptions(options) { * * @param {String|String[]|Options} [options] One or more [glob patterns](https://en.wikipedia.org/wiki/Glob_(programming)) * @return {import('metalsmith').Plugin} + * @example + * // remove all dotfiles that are direct children of metalsmith.source() + * metalsmith.use(remove('.*')) + * // remove all JSON files + * metalsmith.use(remove(['**\/*.json'])) */ function remove(options) { return function remove(files, metalsmith, done) {