# argf

> Ruby's ARGF object for Node.

Latest version **0.0.1** (published 2012-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install argf
pnpm add argf
yarn add argf
bun add argf
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2012-09-03 |
| First published | 2012-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Tokuhiro Matsuno |
| Maintainers | tokuhirom |
| Keywords | ARGF, ruby |

## Links

- npm: https://www.npmjs.com/package/argf
- Repository: https://github.com/tokuhirom/node-argf
- npm.io page: https://npm.io/package/argf

## Recent versions

- 0.0.1 (latest) — 2012-09-03

## README

Ruby's ARGF for node.js
=======================

ARGF is a stream designed for use in scripts that process files given as command-line arguments, or passed in via STDIN.

ARGF is very useful for comand line utilities.

SYNOPSIS
--------

    var ARGF = require('./index.js');

    var argf = new ARGF();
    argf.forEach(function (line) {
        process.stdout.write('LINE(' + (argf.stream.path || '-') + ") " + line);
    });

CLASSES
-------

### ARGF

#### var argf = new ARGF([Array files])

Create a new instance of ARGF. You can pass a argv by yourself.
By default, ARGF uses process.argv as a file list.

If files.length is 0, ARGF reads data from stdin.

#### argf.forEach(function (line) { ... })

This iterates over each line.

#### argf.forEachChar(function (line) { ... })

This iterates over each char.

#### argf.stream

Current stream object. You can get a current file path by `argf.stream.path`.

#### argf.encoding

This is a file encoding. It's `utf-8` by default.

LICENSE
-------

http://tokuhirom.mit-license.org/

---
_Source: https://npm.io/package/argf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
