{"id":15445530,"url":"https://github.com/scriptnull/furious","last_synced_at":"2025-04-04T18:17:41.267Z","repository":{"id":57243221,"uuid":"39286754","full_name":"scriptnull/furious","owner":"scriptnull","description":"Develop command line tools furiously.","archived":false,"fork":false,"pushed_at":"2024-02-25T23:51:10.000Z","size":484,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T04:25:42.087Z","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/scriptnull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2015-07-18T04:37:00.000Z","updated_at":"2015-07-18T07:13:27.000Z","dependencies_parsed_at":"2024-10-30T07:41:24.577Z","dependency_job_id":null,"html_url":"https://github.com/scriptnull/furious","commit_stats":{"total_commits":32,"total_committers":2,"mean_commits":16.0,"dds":0.5,"last_synced_commit":"a3b9534aa2ac98da66b9bf16ed6c31766bf5fb37"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptnull%2Ffurious","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptnull%2Ffurious/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptnull%2Ffurious/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptnull%2Ffurious/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scriptnull","download_url":"https://codeload.github.com/scriptnull/furious/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226191,"owners_count":20904467,"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-01T19:45:11.853Z","updated_at":"2025-04-04T18:17:41.241Z","avatar_url":"https://github.com/scriptnull.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Meet __furious__ - [commander](https://www.npmjs.com/package/commander) inspired elegant solution for creating command line tools.\n\n[![Build Status](https://travis-ci.org/scriptnull/furious.svg?branch=master)](https://travis-ci.org/scriptnull/furious)\n\n__furious__ is ultra __lightweight__ and __less than 100 lines of code__. The API is dead simple and have been modified from commander to make few things simpler.\n\n\nInstallation\n============\n```bash \nnpm install furious --save\n```\n\nAPI\n===\n### furious\n```javascript\nvar furious = require('furious');\n//add commands and options here \nfurious.execute(process.argv , 'Tool for doing string operations'); //execute the user given command.  \n```\n\u003e __NOTE__ : Don't forget to call furious.execute() at the end. It is responsible for executing the user command.\n\n### .command(commandName , description , callback)\nCreate a command with this function.\n- commandName `string` - Command Name. \n- decription `string` - Description for the Command.\n- callback `function(args)` - function to be executed when command is given in the command line. _args_ - array of arguments.\n- Example : `programname upper hello` - Here _upper_ is the Command name and _hello_ is available in _args_ of the callback.\n\n```javascript\nfurious\n  .command('upper' , 'print upper case values' , function(args){\n    var firstArg = args[0];\n    console.log(firstArg.toUpperCase());\n  });\n```\n\n### .option(optionNamesArray , description , callback)\nCreate options for already existing command.\n- optionNamesArray `array` - Option names. Each option name __should start with - or --__\n- description `array` - Description about the Option.\n- callback `function(args)` - function to be executed when option is given in the command line. _args_ - array of arguments.\n- Example : `programname upper -h` - Here _upper_ is Command name and _-h_ is the option.\n\n```javascript\nfurious\n  .command('upper' , 'print upper case values' , function(args){\n    var firstArg = args[0];\n    console.log(firstArg.toUpperCase());\n  })\n  .option(['-h' ,'--help'] , 'Help for Upper' , function(args){\n    console.log('You can provide help for this command here.');\n  });\n```\nIn this case ,both  ``programname upper -h`` and  ``programname upper --help`` invoke the same callback.\n\n### .alias( aliasArray )\nSpecify Alias for commands.\n```javascript\nfurious\n  .command('upper' , 'print upper case values' , function(args){\n    var firstArg = args[0];\n    console.log(firstArg.toUpperCase());\n  })\n  .alias(['up' , 'u']);\n```\n\n### .execute(argv , description , noCommandOrOptionOperation , commonOperation)\nThis is where the user given command on the terminal is parsed and executed. \n- argv `array` - send in __process.argv__ to execute the command given by user.\n- description `string` - Description of the command line tool.\n- noCommandOrOptionOperation `function()` - function to be executed when there is no commands given by user or the command definition is not available.\n- commonOperation `function(argv)` - function to be executed commonly for all the commands. Eg. You may instantiate timers for measuring the performance of your utility here.\n\n```javascript\nvar noCommandOrOptionOperation = function(){ console.log('Please Specify a Command or Option'); };\nvar commonOperation = function(argv){console.log('Welcome to the cli');};\n\nfurious.execute(process.argv , 'Cli for something' , noCommandOrOptionOperation , commonOperation );\n```\nExpect for a `printHelp` function in future versions , that can be easily used in _noCommandOrOptionOperation_ and _commonOperation_.\n\nCaveats\n=======\n- If definition for a command is specified twice then , first definition will be considered and rest are rejected.\n- The package is in beta phase and has few things left behind to do. So watch out for version 1.0.0 , until then , try to play around with it.\n\nContribution\n============\nMore than welcomed. Feel free to send in a pull request or file an issue.\n\nLicense\n=======\n[The MIT License](https://github.com/scriptnull/furious/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptnull%2Ffurious","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscriptnull%2Ffurious","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptnull%2Ffurious/lists"}