{"id":17181524,"url":"https://github.com/dimitarchristoff/clintish","last_synced_at":"2025-03-25T00:43:44.730Z","repository":{"id":9644782,"uuid":"11578865","full_name":"DimitarChristoff/clintish","owner":"DimitarChristoff","description":"cloned clint with primish","archived":false,"fork":false,"pushed_at":"2013-12-16T22:42:58.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T03:32:40.878Z","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/DimitarChristoff.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-07-22T10:35:53.000Z","updated_at":"2013-12-16T22:42:59.000Z","dependencies_parsed_at":"2022-09-04T10:41:27.317Z","dependency_job_id":null,"html_url":"https://github.com/DimitarChristoff/clintish","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimitarChristoff%2Fclintish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimitarChristoff%2Fclintish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimitarChristoff%2Fclintish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimitarChristoff%2Fclintish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DimitarChristoff","download_url":"https://codeload.github.com/DimitarChristoff/clintish/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245377961,"owners_count":20605375,"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-15T00:34:34.504Z","updated_at":"2025-03-25T00:43:44.693Z","avatar_url":"https://github.com/DimitarChristoff.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"clintish\n========\n\nCommand line helper and arguments parser, based upon clint and primeish\n\n## Installing\n\n```sh\nnpm install clintish colors --save\n```\n\n## Use\n\n```javascript\nvar clint = require('clintish')();\nrequire('colors');\n\nvar bool = function(value){\n\t// a boolean helper if a value is present\n\tif (value === 'no' || value === 'false'){\n\t\treturn false;\n\t}\n\tif (value === 'yes' || value === 'true'){\n\t\treturn true;\n\t}\n\treturn value;\n};\n\n// register full cmd line arg and aliases with some help text\nclint.command('--auto', '-a', 'Watch for changes in less files, recompiles main', bool);\nclint.command('--now', '-n', 'Do not keep running, instead - compile now and quit', bool);\nclint.command('--no-compress', '-nc', 'Disable compression settings for less output, enabled by default, eg. ' + '--no-compress'.green + ' to disable', bool);\n\n// register actual args\nclint.command('--log', '-l', 'Set log level, eg. ' + '-l 3'.green);\n\n\nvar cliHelp = function(){\n\t// uses command definitions from above\n\tconsole.log(clint.help(2, ' : '.grey));\n};\n\n// now parser of args\nvar processArguments = function(args){\n\targs = args || process.argv.splice(2);\n\n\tvar options = {\n\t\tcompress: true,\n\t\tauto: false,\n\t\tnow: false,\n\t\tlog: 0\n\t};\n\n\tif (!args.length){\n\t\t// call some cli helper.\n\t\treturn cliHelp();\n\t}\n\n\tclint.on('command', function(name, value){\n\t\tswitch (name){\n\t\t\tcase '--no-compress':\n\t\t\t\toptions.compress = false;\n\t\t\t\tbreak;\n\t\t\tcase '--now':\n\t\t\t\toptions.now = true;\n\t\t\t\tbreak;\n\t\t\tcase '--auto':\n\t\t\t\toptions.auto = true;\n\t\t\t\tbreak;\n\t\t\tcase '--log':\n\t\t\t\toptions.log = Number(value);\n\t\t}\n\t});\n\n\tclint.on('complete', function(){\n\t\trunApp(options);\n\t});\n\n\tclint.parse(args);\n};\n\nprocessArguments();\n```\n\nThat's about all you need to get going and develop node.js CLI apps.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitarchristoff%2Fclintish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimitarchristoff%2Fclintish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitarchristoff%2Fclintish/lists"}