Socket
Book a DemoInstallSign in
Socket

fifo-js

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fifo-js

Filesystem FIFO file handler

Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

FIFO.js

Node.js module provides a class which handles a fifo file.

Installation

npm install fifo-js

Usage

Example

const FIFO = require('fifo-js')

let fifo = new FIFO()

fifo.setReader(console.log.bind(console))

fifo.write('foo')

fifo.close()

Create fifo

The constructor creates a new fifo in /tmp/ if a path isn't provided. If a path is provided and there's an existing fifo with that name it uses that one. Otherwise it creates a new one with that name.

let fifo = new FIFO([path])

Read

let content = fifo.read()

Listener

fifo.setReader(callback)

Write

fifo.write(string)

Close

fifo.close()

Contact

  • http://oskarnyberg.com
  • oskar@oskarnyberg.com

Licence

MIT: https://opensource.org/licenses/MIT

Keywords

fifo

FAQs

Package last updated on 10 Jun 2016

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