New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

circular-append-file

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

circular-append-file

A simple appendable-file interface which enforces a size cap by overwriting itself.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

circular-append-file

A simple appendable-file interface which enforces a size cap by overwriting itself. A good way to maintain a log where you want to drop history after you hit a size limit.

Currently clears the file on open, then will write each append to the end until the maxSize is hit. Will then circle back to the top and continue writing.

Currently only supports strings.

const CircularAppendFile = require('circular-append-file')

let log = CircularAppendFile('./app.log', {
  maxSize: 1024 // 1kb (default is 32mb)
})
log.append('Hello\n')
log.append('World!\n')
log.createReadStream().pipe(process.stdout)
log.close()

Keywords

FAQs

Package last updated on 12 Mar 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc