Socket
Book a DemoInstallSign in
Socket

ed-logwatcher

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ed-logwatcher

Watch Elite: Dangerous journal files

1.4.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

ed-logwatcher

Elite: Dangerous Log Watcher

Install

npm i --save ed-logwatcher

Usage

// See https://edlogs.williamblythe.info for the JSDocs
const {LogWatcher} = require('ed-logwatcher');
const DEFAULT_SAVE_DIR = require('path').join(
	require('os').homedir(),
	'Saved Games',
	'Frontier Developments',
	'Elite Dangerous'
);
const watcher = new LogWatcher(DEFAULT_SAVE_DIR, 3);
	watcher.on('error', err => {
		watcher.stop();
		console.error(err.stack || err);
		throw new Error(err.stack || err);
	});
	watcher.on('finished', () => {
    		// Watcher has read through the max files allowed, won't emit again until another entry
    		// Now would be a good time to load the data, if you are doing something like elite-journal.
    	});
	watcher.on('data', obs => {
		// Emitted for each file in max files allowed.
		obs.forEach(ob => {
			const {timestamp, event} = ob;
			console.log('\n' + timestamp, event);
		 	delete ob.timestamp;
		 	delete ob.event;
		 	Object.keys(ob).sort().forEach(k => {
		 		console.log('\t' + k, ob[k]);
		 	});
		});
	});

Projects Using ed-logwatcher

  • https://github.com/willyb321/elite-journal
  • https://github.com/purrcat259/ed-fleet-client

Contributing

  • Fork
  • Create branch (git checkout -b my-branch)
  • Make changes
  • Commit
  • Open PR.
  • ???
  • Profit.

Keywords

elite

FAQs

Package last updated on 09 Mar 2018

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.