# tcadif

> read and write Amateur Data Interchange Format (ADIF)

Latest version **2.4.0** (published 2026-03-22) · MIT license · 0 weekly downloads

## Install

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

Provides the command `tcadif`.

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

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

## Facts

| | |
|---|---|
| Version | 2.4.0 |
| Published | 2026-03-22 |
| First published | 2023-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 483.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Thomas Cort |
| Maintainers | tcort |
| Keywords | adif, amateur, radio, ham, adi, data, format, log, logger, qso |

## Links

- npm: https://www.npmjs.com/package/tcadif
- Repository: https://github.com/tcort/tcadif
- Homepage: https://github.com/tcort/tcadif#readme
- Issues: https://github.com/tcort/tcadif/issues
- npm.io page: https://npm.io/package/tcadif

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 2.4.0 (latest) — 2026-03-22
- 2.3.0 — 2025-10-04
- 2.2.1 — 2025-08-30
- 2.2.0 — 2024-02-18
- 2.1.0 — 2023-11-28
- 2.0.0 — 2023-11-28
- 1.8.1 — 2023-11-11
- 1.8.0 — 2023-11-11
- 1.7.1 — 2023-11-04
- 1.7.0 — 2023-11-04
- 1.6.0 — 2023-11-01
- 1.5.1 — 2023-10-26
- 1.5.0 — 2023-08-15
- 1.4.1 — 2023-04-19
- 1.4.0 — 2023-04-11
- … 7 more at https://npm.io/package/tcadif/versions

## README

# tcadif

Read and write data in Amateur Data Interchange Format (ADIF) with node.js.

## Examples

### Synchronous ADIF Reading and Writing

#### Reading

To parse ADIF text, simply call `ADIF.parse(text)`. The result is an ADIF
instance. To transform it into a plain old JavaScript object, call `.toObject();`

```
const { ADIF } = require('tcadif');
const fs = require('fs');
const path = require('path');

const input = fs.readFileSync(path.join(__dirname, 'sample.adi')).toString();

const adif = ADIF.parse(input);

console.log(adif.toObject());
```

#### Writing

To write ADIF text, simply instantiate an ADIF instance with an optional header
and qsos. Then call `.stringify()`.

```
const { ADIF } = require('tcadif');
const fs = require('fs');
const path = require('path');

const input = {
    qsos: [
        {
            BAND: '20m',
            CALL: 'KG9JP',
            FREQ: '14',
            MODE: 'SSB',
            NOTES: 'POTA K-4293 WI',
            QSL_RCVD: 'N',
            QSL_SENT: 'N',
            QSO_DATE: '20230217',
            QSO_DATE_OFF: '20230217',
            RST_RCVD: '57',
            RST_SENT: '59',
            TIME_OFF: '172600',
            TIME_ON: '172600',
            TX_PWR: '20'
        }
    ]
};

const adif = new ADIF(input);

console.log(adif.stringify());
```

`.stringify(options = {})` accepts an optional object argument which influences the output:

- `fieldDelim` - a string to insert between fields. Default end-of-line sequence (`\n` or `\r\n`).
- `recordDelim` - a string to insert between records (header and QSOs). Default two end-of-line sequences (`\n` or `\r\n`).
- `programName` - the name of your application. Defaults to this modules package.name (i.e. `tcadif`).
- `programVersion` - the version of your application. Defaults to this module's package.version (e.g. `1.6.1`).
- `verbosity` - controls which fields are included in the output
 - `full` - all fields (default).
 - `compact` - only the required fields `QSO_DATE`, `TIME_ON`, `CALL`, `BAND` or `FREQ`, and `MODE`.

### Streaming ADIF Reading and Writing

#### AdifReader

Read a text stream and ouputs an object stream:

```
'use strict';

const { AdifReader } = require('tcadif');
const fs = require('fs');
const path = require('path');

const input = fs.createReadStream(path.join(__dirname, 'sample.adi'));
const reader = new AdifReader();

reader.on('data', record => console.log('data', record));
reader.on('error', err => console.error('err', err));

input.pipe(reader);
```

#### AdifWriter

Reads an object stream and outputs a text stream:

```
'use strict';

const { AdifWriter } = require('tcadif');

const writer = new AdifWriter();

writer.pipe(process.stdout);

writer.write({
    BAND: '20m',
    CALL: 'VA2EPR',
    MODE: 'CW',
    QSO_DATE: '20230306',
    TIME_ON: '1728',
    OPERATOR: 'VA2NW',
});
```

#### Passthrough

Reads a text stream, transforms it into an object stream, transforms it
back into a text stream, and writes a text stream:

```
'use strict';

const { AdifReader, AdifWriter } = require('tcadif');
const fs = require('fs');
const path = require('path');

const input  = fs.createReadStream(path.join(__dirname, 'sample.adi'));
const reader = new AdifReader();
const writer = new AdifWriter();
const output = fs.createWriteStream(path.join(__dirname, 'sample-2.adi'));

input
    .pipe(reader)
    .pipe(writer)
    .pipe(output);
```

## ADIF Implementation Notes

- QSO valid requires the following fields: `QSO_DATE`, `TIME_ON`, `CALL`, `BAND` or `FREQ`, `MODE`.
- Unknown Application-defined Fields, User-defined Fields, and Deprecated Fields are ignored.
- No referential integrity checks have been implemented (e.g. there are no checks that the state is valid for the country, the band is valid for the frequency, etc)).
- If a field appears more than once in a record, the last instance is the one used.

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