{"id":15608619,"url":"https://github.com/hypercubed/wc.js","last_synced_at":"2026-01-21T13:10:46.662Z","repository":{"id":8621586,"uuid":"10264769","full_name":"Hypercubed/wc.js","owner":"Hypercubed","description":"wc - print newline, word, and byte counts for each file using node.js/javascript.","archived":false,"fork":false,"pushed_at":"2016-01-06T12:43:32.000Z","size":2351,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T03:54:18.144Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/Hypercubed.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"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":"2013-05-24T11:07:30.000Z","updated_at":"2016-07-18T14:54:35.000Z","dependencies_parsed_at":"2022-08-26T05:01:40.809Z","dependency_job_id":null,"html_url":"https://github.com/Hypercubed/wc.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Fwc.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Fwc.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Fwc.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hypercubed%2Fwc.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hypercubed","download_url":"https://codeload.github.com/Hypercubed/wc.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514205,"owners_count":21116899,"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":"2024-10-03T05:21:40.280Z","updated_at":"2026-01-21T13:10:46.656Z","avatar_url":"https://github.com/Hypercubed.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Description\n\nGets newline, word, and byte counts from a stream.  Designed to match output from Unix/Linux wc.  Can be used as a library or from the command line.\n\n## Installation from git\n\n```\ngit clone https://github.com/Hypercubed/wc.js.git\ncd wc.js\nnpm install\nnpm link\n```\n\n## Installation from NPM for command line\n\n```\nnpm install -g wc.js\n```\n\n## Usage from the command line\n\nPrints newline, word, and byte counts from a file, and a total line if more than one file is specified. With no filename, or when filename is -, read standard input.\n\n`wc.js [options] [filename]`\n\nOptions:\n\n    -h, --help             output usage information\n    -V, --version          output the version number\n    -c, --bytes            print the byte counts\n    -w, --words            print the newline counts\n    -l, --lines            print the word counts\n    -L, --max-line-length  print the length of the longest line\n\n## Should work on Linux (fails on Cygwin due to piping issue)\n\n```\ncat filename | wc.js\ngunzip -c filename | wc.js\n```\n\n## Installation from NPM as a library\n\n```\nnpm install wc.js\n```\n\n## Usage through API\n\n```\nvar wc = require('wc.js');\nvar reader = fs.createReadStream(filepath, {\"encoding\": 'utf-8', \"flags\": 'r', \"fd\": null});\nwc.wcStream(reader, callback);\n```\n\nAn optional options object is also accepted.\n\n```\nvar options = { lines: true, maxLineLength: true }\nwc(reader, options, callback);\n```\n\nOptions:\n\n```\n{\n\tlines: true/false;\n\tbytes: true/false;\n\twords: true/false;\n\tmaxLineLength: true/false;\n}\n```\n\n## Running tests\n\n```\nnpm test\n```\n\nor one of these:\n\n```\nmocha -R list -g lorem\nmocha -R list -g big\nmocha -R list -g strange\n```\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2013 J Harshbarger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypercubed%2Fwc.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypercubed%2Fwc.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypercubed%2Fwc.js/lists"}