circular-append-file

WebJar for circular-append-file

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

circular-append-file
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

circular-append-file
WebJar for circular-append-file
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/pfrazee/circular-append-file

Download circular-append-file

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/circular-append-file/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>circular-append-file</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/circular-append-file/
implementation 'org.webjars.npm:circular-append-file:1.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/circular-append-file/
implementation ("org.webjars.npm:circular-append-file:1.0.1")
'org.webjars.npm:circular-append-file:jar:1.0.1'
<dependency org="org.webjars.npm" name="circular-append-file" rev="1.0.1">
  <artifact name="circular-append-file" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='circular-append-file', version='1.0.1')
)
libraryDependencies += "org.webjars.npm" % "circular-append-file" % "1.0.1"
[org.webjars.npm/circular-append-file "1.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : multistream jar [2.1.0,3)

Project Modules

There are no modules declared in this project.

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()

Versions

Version
1.0.1