{"id":28684907,"url":"https://github.com/node-modules/logfilestream","last_synced_at":"2025-06-14T03:07:45.701Z","repository":{"id":4535574,"uuid":"5675898","full_name":"node-modules/logfilestream","owner":"node-modules","description":"Log stream, including auto rolling feature, support multiprocess `append` write at the same time.","archived":false,"fork":false,"pushed_at":"2020-03-12T03:49:23.000Z","size":78,"stargazers_count":12,"open_issues_count":1,"forks_count":2,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-31T19:56:21.905Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/node-modules.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-04T17:19:35.000Z","updated_at":"2023-07-12T11:25:11.000Z","dependencies_parsed_at":"2022-09-15T15:02:04.177Z","dependency_job_id":null,"html_url":"https://github.com/node-modules/logfilestream","commit_stats":null,"previous_names":["node-modules/logfilestream","alibaba-archive/logfilestream"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/node-modules/logfilestream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Flogfilestream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Flogfilestream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Flogfilestream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Flogfilestream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-modules","download_url":"https://codeload.github.com/node-modules/logfilestream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Flogfilestream/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259752078,"owners_count":22905972,"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":[],"created_at":"2025-06-14T03:07:39.451Z","updated_at":"2025-06-14T03:07:45.696Z","avatar_url":"https://github.com/node-modules.png","language":"JavaScript","readme":"logfilestream\n=========\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][cov-image]][cov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/logfilestream.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/logfilestream\n[travis-image]: https://img.shields.io/travis/node-modules/logfilestream.svg?style=flat-square\n[travis-url]: https://travis-ci.org/node-modules/logfilestream\n[cov-image]: http://codecov.io/github/node-modules/logfilestream/coverage.svg?branch=master\n[cov-url]: http://codecov.io/github/node-modules/logfilestream?branch=master\n[david-image]: https://img.shields.io/david/node-modules/logfilestream.svg?style=flat-square\n[david-url]: https://david-dm.org/node-modules/logfilestream\n[snyk-image]: https://snyk.io/test/npm/logfilestream/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/logfilestream\n[download-image]: https://img.shields.io/npm/dm/logfilestream.svg?style=flat-square\n[download-url]: https://npmjs.org/package/logfilestream\n\nLog file stream, including auto rolling feature, support multiprocess `append` write at the same time.\n\n## Install\n\n```sh\n$ npm i logfilestream --save\n```\n\n## Usage\n\n```js\nvar writestream = logfilestream({\n  logdir: '/tmp/logs',\n  nameformat: '[info.]YYYY-MM-DD[.log]',\n});\n\nwritestream.write('hello');\nwritestream.write(' world\\n');\nwritestream.end();\n```\n\n## Options\n\n```js\n/**\n * Log stream, auto cut the log file.\n *\n * log file name is concat with `prename + format + ext`.\n *\n * @param  {Object} options\n *  - {String} logdir, this dir must exists.\n *  - {String} nameformat, default is '[info.]YYYY-MM-DD[.log]',\n *    @see moment().format(): http://momentjs.com/docs/#/displaying/format/\n *    Also support '{pid}' for process pid.\n *  - {String} [encoding], default is utf-8, other encoding will encode by iconv-lite\n *  - {Number} [duration], default is one hour(3600000 ms), must \u003e= 60s.\n *  - {String} [mode], default is '0666'.\n *  - {Number} [buffer] buffer duration, default is 1000ms\n *  - {Boolean} [mkdir] try to mkdir in each cut, make sure dir exist.\n *    useful when your nameformat like 'YYYY/MM/DD/[info.log]'.\n * return {LogStream}\n */\n```\n\n## License\n\n(The MIT License)\n\nCopyright(c) 2012 - 2014 fengmk2 \u003cfengmk2@gmail.com\u003e.\nCopyright(c) 2015 - present node-modules and other contributors.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-modules%2Flogfilestream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-modules%2Flogfilestream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-modules%2Flogfilestream/lists"}