{"_id":"@allegiant/logfile","_rev":"1-0f6f9a8c4b63ec3ae42f91fb8417f7f4","name":"@allegiant/logfile","description":"Simple logfile library.","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.1":{"name":"@allegiant/logfile","version":"0.2.1","description":"Simple logfile library.","author":{"name":"echopoint","email":"echopoint@tutanota.com"},"contributors":[],"license":"MIT","bugs":{"url":"https://github.com/allegiant-js/logfile/issues"},"homepage":"https://github.com/allegiant-js/logfile#readme","repository":{"type":"git","url":"git+https://github.com/allegiant-js/logfile.git"},"main":"index.js","engine":{"node":">= 6"},"scripts":{"lint":"eslint .","test":"tape test/*.js","coverage":"tape test/*.js --coverage --coverage-report=lcov"},"dependencies":{},"devDependencies":{"@allegiant/cmdhelper":"0.0.1","@allegiant/shutdown":"^0.2.1","eslint":"^4.12.1","jsdoc":"^3.5.5","tape":"^4.8.0"},"gitHead":"8f43da6728d0581312a4097529005de28e7c43e5","_id":"@allegiant/logfile@0.2.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"echopoint","email":"echopoint@tutanota.com"},"dist":{"integrity":"sha512-y6kFOzAcRHnP9VJsGOToyDEUKc33aPiwoGVS8MuKAob1cTO3zOYkkqJ+ZZpmAZIxxLtdUsS2WFN/B4rfRFg2oQ==","shasum":"f3c3e7db88c0195377ea1876243aca6f4b788575","tarball":"https://registry.npmjs.org/@allegiant/logfile/-/logfile-0.2.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICa2M7Ua1WvSpWH7G0hgDY4xWKpn63aKcdxRTwiOERgjAiEAyzvzNdRzMq2zSLau+hOCn42V9kG/Xuo/w3MLBGmZ79U="}]},"maintainers":[{"name":"echopoint","email":"echopoint@tutanota.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logfile-0.2.1.tgz_1514491385950_0.8108764577191323"}}},"readme":"# logfile\n\n> Simple logfile library. Provides a simple, effective way to log stdout and stderr to a file of your choice.\n>> There be 🐲 here! The API and functionality are being cemented, anything before a 1.0.0 release is subject to change.\n\n```js\nconst path = require('path');\nconst LogFile = require('../index').LogFile;\n\nvar live = false;\nvar logger = new LogFile( path.resolve('logfile.txt'));\n\nrequire('@allegiant/shutdown')(onShutdown);\nfunction onShutdown(req=false, finished) {\n    console.log(\"Shut down triggered... \", req); // eslint-disable-line\n    if (live !== false)\n        clearInterval(live);\n    \n    if (logger !== false) {\n        console.log(\"Closing log...\"); // eslint-disable-line\n        logger.on('finish', function() {\n            console.log(\"Logging completed\"); // eslint-disable-line\n            finished();\n        });\n        // flushes data to the log file and emits finish event\n        logger.end();\n    } else {\n        finished();\n    }\n}\n\nlive = setInterval(function () {\n    console.log(\"tick\"); // eslint-disable-line\n}, 1000); \n\nconsole.log(\"Started\"); // eslint-disable-line\n```\n\n### Copyright & License\n\nCopyright &copy; 2017 Allegiant. Distributed under the terms of the MIT License, see [LICENSE](https://github.com/allegiant-js/logfile/blob/master/LICENSE)\n\nAvailble via [npm](https://www.npmjs.com/package/@allegiant/logfile) or [github](https://github.com/allegiant-js/logfile).\n","maintainers":[{"name":"gabrielcsapo","email":"gabecsapo@gmail.com"},{"name":"echopoint","email":"echopoint@tutanota.com"}],"time":{"modified":"2022-04-04T13:31:42.933Z","created":"2017-12-28T20:03:06.801Z","0.2.1":"2017-12-28T20:03:06.801Z"},"homepage":"https://github.com/allegiant-js/logfile#readme","repository":{"type":"git","url":"git+https://github.com/allegiant-js/logfile.git"},"contributors":[],"author":{"name":"echopoint","email":"echopoint@tutanota.com"},"bugs":{"url":"https://github.com/allegiant-js/logfile/issues"},"license":"MIT","readmeFilename":"README.md"}