{"id":19475471,"url":"https://github.com/artdecocode/usually","last_synced_at":"2025-06-23T08:36:30.041Z","repository":{"id":57388858,"uuid":"136707314","full_name":"artdecocode/usually","owner":"artdecocode","description":"Print usage of a Node.js command-line application.","archived":false,"fork":false,"pushed_at":"2019-04-12T19:02:20.000Z","size":87,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T20:58:55.328Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artdecocode.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":"2018-06-09T08:58:52.000Z","updated_at":"2024-02-09T14:07:41.000Z","dependencies_parsed_at":"2022-09-19T02:32:49.509Z","dependency_job_id":null,"html_url":"https://github.com/artdecocode/usually","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdecocode%2Fusually","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdecocode%2Fusually/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdecocode%2Fusually/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdecocode%2Fusually/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artdecocode","download_url":"https://codeload.github.com/artdecocode/usually/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250834066,"owners_count":21494902,"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-11-10T19:33:01.804Z","updated_at":"2025-04-25T14:31:50.661Z","avatar_url":"https://github.com/artdecocode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# usually\n\n[![npm version](https://badge.fury.io/js/usually.svg)](https://npmjs.org/package/usually)\n\n_Usually_ Will Generate Usage Of Node.JS Command-Line Applications. It is compatible with [_Argufy_](https://artdecocode.com/argufy/) which can save arguments in the `arguments.xml` file, and extract them with auto-generated JavaScript compatible with _Google Closure Compiler_.\n\n```sh\nyarn add -E usually\n```\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/0.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\n## Table Of Contents\n\n- [Table Of Contents](#table-of-contents)\n- [API](#api)\n- [`usually(config: Config): string`](#usuallyconfig-config-string)\n  * [`_usually.Config`](#type-_usuallyconfig)\n- [Argufy Integration](#argufy-integration)\n- [Copyright](#copyright)\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/1.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## API\n\nThe package is available by importing its default function:\n\n```js\nimport usually from 'usually'\n```\n\nThe types and [externs](externs.js) for _Google Closure Compiler_ via [**_Depack_**](https://github.com/dpck/depack) are defined in the `_usually` namespace.\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/2.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## `usually(`\u003cbr/\u003e\u0026nbsp;\u0026nbsp;`config: Config,`\u003cbr/\u003e`): string`\n\nCreate a string to display as a help message.\n\n__\u003ca name=\"type-_usuallyconfig\"\u003e`_usually.Config`\u003c/a\u003e__: The configuration object.\n\n|    Name     |              Type               |                               Description                               |\n| ----------- | ------------------------------- | ----------------------------------------------------------------------- |\n| __usage*__  | _!Object\u0026lt;string, string\u0026gt;_ | The map with possible arguments (flags, options) and their information. |\n| description | _string_                        | What does the program do?                                               |\n| line        | _string_                        | The summary of the program in one line.                                 |\n| example     | _string_                        | The example of the program usage.                                       |\n\n```js\nimport usually from 'usually'\n\nconst res = usually({\n  usage: {\n    '-h': 'print help',\n    '-c': 'execute this command',\n  },\n  description: 'A test command-line application',\n  line: 'usually [-c command|command2] [-h]',\n  example: 'usually -c command2',\n})\n\nconsole.log(res)\n```\n```fs\nA test command-line application\n\n  usually [-c command|command2] [-h]\n\n\t-h\tprint help\n\t-c\texecute this command\n\n  Example:\n\n    usually -c command2\n```\n\n---\n\nThe algorithm will tab the usage object and all new lines will appear indented to the required padding.\n\n```js\nimport usually from 'usually'\n\nconst res = usually({\n  usage: {\n    '-h': 'print help',\n    '-c': `execute this command, that will perform\nthe operations on the CPU and return result\nupon the full execution or terminate after\n30s of inactivity.`,\n  },\n  description: 'Run the usually',\n})\n```\n```fs\nRun the usually\n\n\t-h\tprint help\n\t-c\texecute this command, that will perform\n\t  \tthe operations on the CPU and return result\n\t  \tupon the full execution or terminate after\n\t  \t30s of inactivity.\n```\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/3.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## Argufy Integration\n\n_Argufy_ is a program that manages arguments for CLI programs by storing them in a separate XML file so that they are readily updatable in both source code and README documentation. It also generates the script that extracts those arguments and works with _Google Closure Compiler_. [Read More](https://github.com/artdecocode/argufy#usually-integration).\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/4.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## Copyright\n\n(c) [Art Deco][1] 2019\n\n[1]: https://artd.eco\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\u003cimg src=\".documentary/section-breaks/-1.svg?sanitize=true\"\u003e\u003c/a\u003e\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartdecocode%2Fusually","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartdecocode%2Fusually","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartdecocode%2Fusually/lists"}