Skip to content

Commit

Permalink
Added .process()
Browse files Browse the repository at this point in the history
Process files through plugins without writing out files
  • Loading branch information
woodyrew committed Aug 11, 2016
1 parent cb818d0 commit f368c7d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/index.js
Expand Up @@ -198,6 +198,18 @@ Metalsmith.prototype.build = unyield(function*(){
return files;
});

/**
* Process files through plugins without writing out files.
*
* @return {Object}
*/

Metalsmith.prototype.process = unyield(function*(){
var files = yield this.read();
files = yield this.run(files);

This comment has been minimized.

Copy link
@Ajedi32

Ajedi32 Aug 12, 2016

Member

Minor nitpick: you should probably have the build function call process to avoid duplicating this code in two places.

This comment has been minimized.

Copy link
@woodyrew

woodyrew Aug 12, 2016

Author Member

Good point. I'll make the change in the PR.

return files;
});

/**
* Run a set of `files` through the plugins stack.
*
Expand Down

1 comment on commit f368c7d

@woodyrew
Copy link
Member Author

@woodyrew woodyrew commented on f368c7d Aug 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ajedi32 I committed this by accident via the GitHub interface. I wanted to do a PR but I forgot about my rights. Does it look ok to you?

I'll do a PR for documentation for it with a minor version bump.

Please sign in to comment.