
Security News
Official Go SDK for MCP in Development, Stable Release Expected in August
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Make your function buffer calls till you flush.
Useful to make Backtrace logging.
npm install fn-buffer
new BufferedFunction(fn, opts)
fn
<function>(required)
The function to buffer calls ofopts
[number|object]
Options or capacity
opts.capacity
[number=10]
Capacity of the ring-buffer of the callsopts.flush
[boolean|number=capacity]
Auto-flush when buffer gets fullopts.reverse
[boolean]
Reverse the order of buffer callsimport BufferedFunction from 'fn-buffer'
const bufferedLog = new BufferedFunction(console.log);
bufferedLog('a')
bufferedLog('b')
bufferedLog('c')
bufferedLog('d')
bufferedLog('e')
/* Doesn't log anything yet */
bufferedLog.flush();
/* Logs everything at once */
This can be used to create backtrace-logging:
import BufferedFunction from 'fn-buffer'
export const debug = BufferedFunction(console.debug, { flush: false })
process.on('uncaughtExceptionMonitor', debug.flush)
This debug
function will only log to console in the event of an uncaughtException
.
See backtrace-logging for a module that does exactly this.
FAQs
Buffer function calls till you flush
The npm package fn-buffer receives a total of 17 weekly downloads. As such, fn-buffer popularity was classified as not popular.
We found that fn-buffer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.