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 for the latest version can be found on our Github Pages Site
Or generated locally with
npm run doc
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
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
tak stream
Example of a couple different operations:
tak <command> <subcommand>
tak mission list
tak package list
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
Variable | Notes |
---|---|
TAK_P12_PASSWORD |
Avoid the P12 Password prompt when using in a script |
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`);
});
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);