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

Package detail

ed-logwatcher

willyb32147MIT1.4.1

Watch Elite: Dangerous journal files

elite, dangerous, ed, journal, file, watcher, poll, watch

readme

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

Contributing

  1. Fork
  2. Create branch (git checkout -b my-branch)
  3. Make changes
  4. Commit
  5. Open PR.
  6. ???
  7. Profit.

changelog

Change Log

v1.4.0 (2017/11/06 01:33 +00:00)

  • 597f4ae v1.4.0 (@willyb321)
  • b1dca0c Merge branch 'release/1.4.0' (@willyb321)
  • 5cec0b4 add ignoreInitial parameter, @types, and a test (@willyb321)
  • f115960 update projects using (@willyb321)
  • bd0daf5 add test logs (@willyb321)

v0.3.1 (2017/10/14 06:22 +00:00)

  • b67ec77 0.3.1 (@willyb321)
  • 149206f update dist (@willyb321)
  • 2a5bef1 Remove raven, add some tests, stuff (@willyb321)
  • f50f2f3 add code of conduct, update readme, etc (@willyb321)
  • d7349f3 dont spam console with stats (@willyb321)
  • f72531f update package-lock.json (@willyb321)
  • 3c26008 Merge remote-tracking branch 'origin/master' (@willyb321)
  • 5c9c662 remove fs-extra dep (@willyb321)

v0.3.0 (2017/10/13 12:08 +00:00)

v0.2.4 (2017/10/13 12:06 +00:00)

v0.2.3 (2017/10/13 06:43 +00:00)

v0.2.2 (2017/10/13 06:35 +00:00)

  • 96e778a 0.2.2 (@willyb321)
  • 1222795 uncomment some stuff (@willyb321)
  • 2fd73d4 forgot to remove that (@willyb321)
  • 7c30f66 add webstorm watch task (@willyb321)

v0.2.1 (2017/10/13 06:23 +00:00)

  • 8819c0e 0.2.1 (@willyb321)
  • e114e48 update dist (@willyb321)
  • 3200633 update readme (@willyb321)
  • edb6574 Add jsdoc and a tutorial (@willyb321)

v0.2.0 (2017/10/13 05:56 +00:00)