{"id":16022342,"url":"https://github.com/karliatto/csv-parser-nodejs-cli","last_synced_at":"2026-04-28T20:01:48.632Z","repository":{"id":129936453,"uuid":"88663583","full_name":"karliatto/csv-parser-nodejs-cli","owner":"karliatto","description":"A CLI with nodeJS for parsing csv files","archived":false,"fork":false,"pushed_at":"2017-05-14T15:43:19.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T04:16:43.967Z","etag":null,"topics":["cli","csv","javascript","nodejs"],"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/karliatto.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-18T19:39:47.000Z","updated_at":"2023-02-16T02:16:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"d3f72277-08c7-48ce-bc34-720fb82eac7c","html_url":"https://github.com/karliatto/csv-parser-nodejs-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/karliatto/csv-parser-nodejs-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karliatto%2Fcsv-parser-nodejs-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karliatto%2Fcsv-parser-nodejs-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karliatto%2Fcsv-parser-nodejs-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karliatto%2Fcsv-parser-nodejs-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karliatto","download_url":"https://codeload.github.com/karliatto/csv-parser-nodejs-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karliatto%2Fcsv-parser-nodejs-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32396781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","csv","javascript","nodejs"],"created_at":"2024-10-08T18:23:03.298Z","updated_at":"2026-04-28T20:01:48.593Z","avatar_url":"https://github.com/karliatto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A CLI with [nodeJS](https://nodejs.org/)\n\n## Create a git repository\n\n```bash\ngit init\n```\n\n## Create a package.json file\n```bash\nnpm init\n```\n## Create a new file: hello-world.js\n```javascript\n\n console.log('hello world'); \n\n ```\n\n## Install [commanderjs](https://github.com/tj/commander.js)\n```bash\nnpm install commander --save \n```\n```javascript\nvar program = require('commander');\n\nprogram\n  .version('0.0.1')\n  .option('-l, --list [list]', 'List of customers in CSV')\n  .parse(process.argv)\n```\n\n```bash\nnode hello-world --list 'hello world' \nnode hello-world --version \nnode hello-world --help\n\n```\n\n## Install [node-csv](https://github.com/wdavidw/node-csv)\n\n```bash\nnpm install csv --save\n```\n\n```javascript\nvar csv = require('csv');\nvar fs = require('fs');\n\nvar parse = csv.parse;\nvar stream = fs.createReadStream(program.list)\n    .pipe(parse({ delimiter : ',' }));\n\nstream\n\t.on('data', function (data) {\n\t\tvar firstname = data[0];\n\t\tvar lastname = data[1];\n\t\tvar email = data[2];\n\t\tconsole.log(firstname, lastname, email);\n\t})\n```\n\n```bash\nnode hello-world --list people.csv\n```\n\n\n## Improving the output\n\n```bash\nnpm install chalk --save\n```\n\n```javascript\n\t.on('end', function() {\n\t\tconsole.log(chalk.green('success'));\n\t})\n```\n\n## Finally doing a bash command\n[Shebang/Hasbang](https://en.wikipedia.org/wiki/Shebang_(Unix)) Under Unix-like operating systems, when a script with a shebang is run as a program.\n- Add shebang at the top of the file\n```\n#!/usr/bin/env node\n```\n\n```javascript \n  \"bin\": {\n    \"hello-world\": \"./hello-world.js\"\n  }\n```\n\n```bash\nsudo npm install -g\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarliatto%2Fcsv-parser-nodejs-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarliatto%2Fcsv-parser-nodejs-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarliatto%2Fcsv-parser-nodejs-cli/lists"}