{"id":16421365,"url":"https://github.com/leomp12/console-files","last_synced_at":"2025-02-24T17:42:35.596Z","repository":{"id":33272207,"uuid":"156934141","full_name":"leomp12/console-files","owner":"leomp12","description":"Simple package to handle console output to files","archived":false,"fork":false,"pushed_at":"2023-03-03T05:02:20.000Z","size":176,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-16T10:37:55.774Z","etag":null,"topics":["error-log","javascript-console","js-logger","log-files","node-debug","nodejs-console"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leomp12.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-10T00:52:03.000Z","updated_at":"2022-02-13T02:18:28.000Z","dependencies_parsed_at":"2024-11-10T09:40:40.594Z","dependency_job_id":"ba97ec84-e5fa-4f87-8eee-087f6b420b6d","html_url":"https://github.com/leomp12/console-files","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":"0.23809523809523814","last_synced_commit":"632eec3f8831bd1253a9849c5f68eaee9cb90375"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leomp12%2Fconsole-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leomp12%2Fconsole-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leomp12%2Fconsole-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leomp12%2Fconsole-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leomp12","download_url":"https://codeload.github.com/leomp12/console-files/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240525705,"owners_count":19815520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["error-log","javascript-console","js-logger","log-files","node-debug","nodejs-console"],"created_at":"2024-10-11T07:32:23.550Z","updated_at":"2025-02-24T17:42:35.575Z","avatar_url":"https://github.com/leomp12.png","language":"JavaScript","readme":"# console-files\n\nSimple Node.js package to write application outputs to files.\n\nIt works as a default JavaScript\n[`Console`](https://developer.mozilla.org/en-US/docs/Web/API/Console) object,\nbut with special handlers for `.log` and `.error` methods,\nsaving output to configured files.\n\nIt also treats application fatal errors\n(`uncaughtException`), appending error message to file\nbefore exiting process.\n\n## Using\n\n```bash\nnpm i --save console-files\n```\n\n```js\nconst logger = require('console-files')\n\n/*\nDo the stuff\n*/\n\nlogger.log('Hello console-files!')\n\n/*\nMore work to do\n*/\n\nlogger.error(new Error('Keep calm, it is just a test ;)'))\n```\n\n## Configuration\n\nIt's configurable through the following\nenvironment variables:\n\nEnvironment variable  | Method   | Default\n---                   | ---      | ---\n`LOGGER_OUTPUT`       | `.log`   | `./logger.out`\n`LOGGER_ERRORS`       | `.error` | `./logger.err`\n`LOGGER_FATAL_ERRORS` | -        | `./_stderr`\n`LOGGER_SKIP_FATAL`   | -        | -\n\n## Development and production\n\n`console-files` checks the `NODE_ENV`\nto work differently for production and development modes:\n\n```js\nconst devMode = process.env.NODE_ENV !== 'production'\n```\n\n- On dev mode it'll output to default console,\nunless the `LOGGER_OUTPUT` or `LOGGER_FATAL_ERRORS`\nenv variable is explicitly set;\n\n- On production mode it'll output only to files;\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleomp12%2Fconsole-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleomp12%2Fconsole-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleomp12%2Fconsole-files/lists"}