Giter VIP home page Giter VIP logo

bintail's Introduction

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

bintail's People

Contributors

deoxxa avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

kshmir

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.