logfmt2

logfmt2 (which is based on the original logfmt and the original blog post) is a module for encoding objects into the logfmt format and decoding them again.
Install
npm install @jclem/logfmt2
Build
script/build
Publish
The script/publish
script cleans the build directory, builds the project, and then runs npm publish
.
script/publish
Usage
const {Logger, encode, decode} = require('@jclem/logfmt2')
console.log(encode({foo: 'bar'}))
console.log(decode('foo=bar'))
Logger.log({foo: 'bar'})
const logger = new Logger({ns: 'my-app'})
logger.log({foo: 'bar'})
logger.time('elapsedMs')
logger.log({foo: 'bar'})
logger.log({foo: 'bar'})
logger.appendContext({new_context: 'hello'})
logger.log({foo: 'bar'})