I’ve shipped a new version of Lorry, my tiny ES module for building and shaping payloads in Node/Express apps. Lorry makes it easy to merge/replace/reset data, set flash messages, and attach structured errors—without worrying about stomping on class methods.
Grab it:
npm i @jessetraynham/lorry@latest
# or
npm i @jessetraynham/lorry@1.10.0
What’s new
- Session-aware Flash
Flash()can now read/write to a session object. You can also scope messages with a simpleidso different flows don’t collide.- Signatures supported:
 
 
Flash(title, message, fields)
Flash(message)
Flash(fields)
Flash() // retrieve + clear from session
- 
Extras in
fieldsget shallow-merged (e.g.,{ type: 'info' }). Empty/undefined values are dropped automatically. - 
Method protection via Proxy
Built-in methods can’t be overwritten by accident. If you try, Lorry blocks it (silently) and logs whenverboseorerrorLoggingis on. - 
Deep merge improvements
Safer object checks and a small early-exit to avoid work on empty sources. - 
Tests and polish
Added Jest coverage for the new Flash behavior, session integration, cleanup, and logging. Package now includes an exports map, engines field (node >= 18), and a small cleanup of keywords. 
Quick example
import Lorry from '@jessetraynham/lorry'
// Set a flash and persist to session
const payload = new Lorry({}, { session: req.session, id: 'settings' })
.Merge({ userId: 123 })
.Flash('Saved', 'Your profile was updated.', { type: 'success' })
// Later request: read and clear it
const view = new Lorry({}, { session: req.session, id: 'settings' })
.Flash()
res.render('settings', view)
Why Lorry?
- Zero framework lock-in. It’s just a class instance you can hand to 
res.render()or any function. - Predictable shape. Errors live in 
err. Flash lives inflash. Your own keys are yours. - Chainable. 
Merge().Flash().Throw()reads like what you meant to do. 
Learn more
Docs, examples, and API details are here:
https://www.jessetraynham.com/javascript/lorry