Assemble pipeline plugin for handling custom middleware stages in the Assemble build system. Version 1.0.0 is the latest stable release, updated on npm with monthly downloads. It allows you to create and manage middleware stages like 'onStream', 'preWrite', and 'postWrite', and handle them on files via .pipe(). The package also provides a .once() method to prevent middleware from running multiple times for the same stage. Key differentiator: tightly integrated with Assemble, not a general-purpose middleware runner.
npm install assemble-handleVerified import paths — ran on the pinned version, not inferred.
Demonstrates creating handlers, adding middleware, and using handle in a pipeline task.
Use handle(app, 'stageName'), not handle('stageName', app).Understand that .once() resets per stream; use other dedup patterns if needed.
Always call app.handler('stageName') before accessing app.onStage or using handle.Consider migrating to Gulp or other modern pipelines.
Ensure you npm install assemble-core and require it before assemble-handle.
Add app.handler('onStream') before calling handle(app, 'onStream').Add const handle = require('assemble-handle'); at top of file.