Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@tak-ps/node-tak

dfpc-coe997MIT10.2.0TypeScript support: included

Lightweight JavaScript library for communicating with TAK Server

tak, atak, wintak, cot, cusor, target, tactical

readme

Node-TAK

Javascript TAK Server Library

Lightweight JavaScript library for managing TAK TLS connections for streaming CoT data as well as a typed SDK for performing TAK Server REST API operations

API Documentation

API Documentation for the latest version can be found on our Github Pages Site

Or generated locally with

npm run doc

Installation

NPM

To install node-tak with npm run

npm install @tak-ps/node-tak

or for use with the global CLI:

npm install --global @tak-ps/node-tak

CLI Usage Examples

Initial Setup

The initial run of the CLI will generate a new Connection Profile & Credentials

tak

Once the profile is generated you can specify it with --profile <profile> in any command or if it is not provided it will be interactively requested

Streaming COTs

tak stream

API Operations

Example of a couple different operations:

tak <command> <subcommand>
tak mission list
tak package list

Command Line Args

The following command line args are supported by all or many of the different command modes

Use custom P12 cert file

--auth <p12 file to use>

Output Raw JSON where possible

--format json

Environment Variables

Variable Notes
TAK_P12_PASSWORD Avoid the P12 Password prompt when using in a script

SDK Usage Examples

Basic Streaming COT Usage

import TAK from '@tak-ps/node-tak';

const tak = await TAK.connect('ConnectionID', new URL('https://tak-server.com:8089'), {
    key: conn.auth.key,
    cert: conn.auth.cert
});

tak.on('cot', async (cot: CoT) => {
    console.error('COT', cot); // See node-cot library
}).on('end', async () => {
    console.error(`Connection End`);
}).on('timeout', async () => {
    console.error(`Connection Timeout`);
}).on('ping', async () => {
    console.error(`TAK Server Ping`);
}).on('error', async (err) => {
    console.error(`Connection Error`);
});

Basic API Usage

import { TAKAPI, APIAuthCertificate } from '@tak-ps/node-tak'

const api = await TAKAPI.init(new URL('TAK SERVER Marti API & Port'), new APIAuthCertificate(auth.cert, auth.key));

const missions = await api.Mission.list(req.query);

console.error(missions);

changelog

CHANGELOG

Emoji Cheatsheet

  • :pencil2: doc updates
  • :bug: when fixing a bug
  • :rocket: when making general improvements
  • :white_check_mark: when adding tests
  • :arrow_up: when upgrading dependencies
  • :tada: when adding new features

Version History

v10.2.0

  • :arrow_up: Update Mission Response expectations

v10.1.0

  • :arrow_up: Include CA list in SignClient list

v10.0.0

  • :arrow_up: Migrate to node-cot@13

v9.3.2

  • :arrow_up: Update Core Deps

v9.3.1

  • :arrow_up: Update Core Deps

v9.3.0

  • :tada: Add Profile Connection API Call

v9.2.2

  • :arrow_up: Update Core Deps

v9.2.1

  • :bug: Ensure MissionTokens are used internally if present in a top level call

v9.2.0

  • :rocket: Ensure Mission Name meets regex/length requirements of TAK Server on creation
  • :tada: Add Locate API SDK

v9.1.0

  • :rocket: Register and validate --format flag in CLI
  • :tada: Allow specifying custom p12 file for auth

v9.0.1

  • :bug: Fix Global bin registration

v9.0.0

  • :rocket: Breaking Change TAK constructor & connect sig. to make CloudTAK used props optional
  • :tada: Introduce new CLI
  • :tada: Introduce Files.list API Integration

v8.10.0

  • :rocket: Support additional TLS options

v8.9.0

  • :rocket: Allow getting & setting repeater period

v8.8.1

  • :bug: Fix relative path

v8.8.0

  • :rocket: Add exports field to package.json

v8.7.0

  • :tada: Add ability to delete Repeater

v8.6.0

  • :tada: Add initial support for the Repeaters API

v8.5.0

  • :tada: Add initial support for the Injectors API

v8.4.1

  • :bug: Fix named export

v8.4.0

  • :tada: Include TAK API Operations SDK

v8.3.0

  • :rocket: Events are always forwarded regardless of destroyed status
  • :arrow_up: Update all core deps

v8.2.1

  • :rocket: Explicit TS return defs

v8.2.0

  • :arrow_up: Update all core deps

v8.1.0

  • :arrow_up: Update all core deps

v8.0.0

  • :arrow_up: Update required node-cot version to 12

v7.0.0

  • :arrow_up: Update required node-cot version to 11

v6.0.0

  • :arrow_up: Update required node-cot version to 10

v5.0.0

  • :arrow_up: Update required node-cot version to 9

v4.4.0

  • :rocket: Remove Remainder

v4.3.1

  • :bug: Optimize Regex Compilation

v4.3.0

  • :bug: Optimize Regex Compilation

v4.2.0

  • :bug: Fix remainder values for multi-line regex

v4.1.1

  • :bug: Fix lints

v4.1.0

  • :rocket: Support parsing XML CoTs with multiline fields

v4.0.2

  • :arrow_up: Add necessary library types

v4.0.1

  • :arrow_up: Update required node-tak version to 8.0.1

v4.0.0

  • :arrow_up: Update required node-tak version to 8

v3.0.0

  • :arrow_up: Update required node-tak version to 7

v2.1.2

  • :rocket: Add automatic GH Release

v2.1.1

  • :arrow_up: Move ts-eslint to dev deps

v2.1.0

  • :arrow_up: Update to ESLint Flat Config System

v2.0.1

  • :white_check_mark: Fix tests

v2.0.0

  • :arrow_up: Update `node-cot@6.1Which uses the new.properties.metadata` for user defined properties

v1.9.0

  • :arrow_up: Increase Ping Aggressiveness

v1.8.0

v1.7.0

  • :bug: Fix leak where retries would spin up new Ping Intervals

v1.6.1

  • :bug: Fix capture group to not be numbered

v1.6.0

  • :bug: Update regex in findCoT to find <event> but not <events>
  • :arrow_up: Update to latest deps

v1.5.0

  • :arrow_up: Update to latest deps
  • :rocket: Add secureConnect event

v1.4.0

  • :bug: Destory client when a new client is created after reconnect is called

v1.3.0

  • :rocket: Perform initial parsing in try/catch
  • :rocket: Remove ts-ignores now that node-cot has strong type defs

v1.2.0

  • :arrow_up: Move node-cot to peerDependencies

v1.0.2

  • :arrow_up: Update node-cot

v1.0.1

  • :arrow_up: Update node-cot

v1.0.0

  • :arrow_up: Update node-cot

v0.4.2

  • :arrow_up: Update node-cot

v0.4.1

  • :arrow_up: Update node-cot

v0.4.0

  • :rocket: Update node-cot to support encoding Polygons and LineStrings

v0.3.3

  • :bug: Non-Zero Opacity Level

v0.3.2

  • :bug: Close Polygons in Node-CoT

v0.3.1

  • :bug: Bump Build

v0.3.0

  • :bug: Properly encode Polygons in Node-COT

v0.2.0

  • :bug: Fix Lint Errors

v0.1.0

  • :pencil2: Add a CHANGELOG, Initial Commit