Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Like tail -f, but binary-safe!
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
LICENSE.md
README.md
bintail.js
example.js
package.json

README.md

Bintail

Like tail -f, but binary-safe!

Overview

This is a very simple, probably naiive, binary-safe tail -f implementation for Node.JS. The thing that makes this module different from most of the others on NPM is that it doesn't rely on the actual tail command (what the hell, right?,) doesn't rely on any external dependencies, and is written in a way that makes it possible to read for people who aren't robots.

Why didn't this exist already?

Super Quickstart

Doesn't get much easier.

var Bintail = require("bintail");

Bintail.createReadStream("./log.txt").pipe(process.stdout);

Installation

Available via npm:

$ npm install bintail

Or via git:

$ git clone git://github.com/deoxxa/bintail.git node_modules/bintail

API

constructor

Constructs a new Bintail object, providing a filename and optionally some other parameters. It's usually easier to just use createReadStream.

new Bintail(filename, [options]);
// basic instantiation
var bt = new Bintail("./log.txt");

// instantiation with a start offset
var bt = new Bintail("./log.txt", {start: 100});

Arguments

  • filename - a string
  • options - an object specifying options

createReadStream

Creates a new Bintail object and returns it. I can't believe it's not fs.createReadStream()!

Bintail.createReadStream(filename, [options]);
require("bintail").createReadStream("./log.txt").pipe(process.stdout);

Arguments

  • filename - a string
  • options - an object specifying options

License

3-clause BSD. A copy is included with the source.

Contact

Something went wrong with that request. Please try again.