{"id":22367615,"url":"https://github.com/hugojosefson/nodejs-example-cli","last_synced_at":"2025-07-11T03:36:55.264Z","repository":{"id":57116763,"uuid":"105906573","full_name":"hugojosefson/nodejs-example-cli","owner":"hugojosefson","description":"Simple example CLI app in Node.js, using ES Modules.","archived":false,"fork":false,"pushed_at":"2020-06-07T09:26:44.000Z","size":466,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-04T04:07:42.397Z","etag":null,"topics":["cli","example","nodejs","template"],"latest_commit_sha":null,"homepage":"https://github.com/hugojosefson/nodejs-example-cli#readme","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/hugojosefson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-05T15:23:31.000Z","updated_at":"2023-02-24T00:35:17.000Z","dependencies_parsed_at":"2022-08-22T22:20:21.638Z","dependency_job_id":null,"html_url":"https://github.com/hugojosefson/nodejs-example-cli","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/hugojosefson/nodejs-example-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugojosefson%2Fnodejs-example-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugojosefson%2Fnodejs-example-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugojosefson%2Fnodejs-example-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugojosefson%2Fnodejs-example-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugojosefson","download_url":"https://codeload.github.com/hugojosefson/nodejs-example-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugojosefson%2Fnodejs-example-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264722161,"owners_count":23654069,"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":["cli","example","nodejs","template"],"created_at":"2024-12-04T18:19:26.496Z","updated_at":"2025-07-11T03:36:55.212Z","avatar_url":"https://github.com/hugojosefson.png","language":"JavaScript","readme":"# Node.js example CLI app\n\n[![Build Status](https://travis-ci.org/hugojosefson/nodejs-example-cli.svg?branch=master)](https://travis-ci.org/hugojosefson/nodejs-example-cli)\n[![npm page](https://img.shields.io/npm/v/@hugojosefson/example-cli.svg)](https://npmjs.com/package/@hugojosefson/example-cli)\n[![License MIT](https://img.shields.io/npm/l/@hugojosefson/example-cli.svg)](https://tldrlegal.com/license/mit-license)\n[![SemVer 2.0.0](https://img.shields.io/badge/SemVer-2.0.0-lightgrey.svg)](https://semver.org/spec/v2.0.0.html)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n## Introduction\n\nThis is a simple CLI app in Node.js, using ES Modules.\n\n### Using as a template\n\n_To use this project as a template for your own project, you can do this:_\n\n```bash\nmkdir my-cli\ncd my-cli\ngit init\ncurl https://codeload.github.com/hugojosefson/nodejs-example-cli/tar.gz/master | tar xzv --strip-components=1\ngit add --all\ngit commit -m 'Add template files from nodejs-example-cli.'\nyarn\n```\n\n_You may wish to make it more your own project:_\n\n```bash\nexport GITHUB_REPO='xxxx/yyyy'   # replace with your project's github repo\nexport BIN_NAME='yyyy'           # replace with name of main binary\nexport NPM_NAME='@xxxx/yyyy'     # optional: your project's npm name\n\nnpx replace '\"version\": \"[^\"]+\"'              '\"version\": \"0.0.1\"'       package.json\nnpx replace '\"description\": \"[^\"]+\"'          '\"description\": \"\"'        package.json\nnpx replace '\"author\": \"[^\"]+\"'               '\"author\": \"\"'             package.json\nnpx replace '@hugojosefson/example-cli'       \"${NPM_NAME:-${BIN_NAME}}\" . --recursive\nnpx replace 'hugojosefson/nodejs-example-cli' \"${GITHUB_REPO}\"           . --recursive\nnpx replace 'example-cli'                     \"${BIN_NAME}\"              . --recursive\nnpx replace '^#+ Using as [\\S\\s]+(## P(re)+)' '$1'                       README.md\nnpx replace '\"keywords\":[^\\]]*\\][^\"]*'        ''                         package.json\nrm CHANGELOG.md\nyarn\n\ngit add --all\ngit commit -m \"Rename project to ${NPM_NAME}.\"\n```\n\n_Then edit `package.json` and go on developing!_\n\n## Prerequisite\n\nNode.js, `v13.2.0` or higher, ideally at least `v14.0.0`.\n\nRecommended to install latest via [nvm](https://github.com/nvm-sh/nvm#readme):\n\n```bash\nnvm install stable\n```\n\n## Usage\n\n```bash\nnpx --package @hugojosefson/example-cli example-cli greet \"Your Name\"\n```\n\nWill say hello to you.\n\n## Programmatic access\n\nYou can also `import` the module, and use its exported functions\nprogrammatically.\n\n### API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n#### identity\n\nReturns the supplied argument.\n\n##### Parameters\n\n- `a` **any** Any argument.\n\nReturns **any** The argument a.\n\n#### generateGreeting\n\nGenerates a greeting.\n\n##### Parameters\n\n- `options`\n  **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**\n  - `options.whom`\n    **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**\n    Whom to greet.\n  - `options.language`\n    **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**\n    Optional. Language of greeting, `en` or `sv`. Default `en`.\n\nReturns\n**[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\u0026lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e**\nA Promise of a greeting.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugojosefson%2Fnodejs-example-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugojosefson%2Fnodejs-example-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugojosefson%2Fnodejs-example-cli/lists"}