{"name":"tiny-bin","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/tiny-bin.git"},"description":"A library for building tiny and beautiful command line apps.","version":"1.0.2","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","prepublishOnly":"tsex prepare"},"keywords":["tiny","bin","command","line","app","cli"],"dependencies":{"get-current-package":"^1.0.0","tiny-colors":"^2.0.1","tiny-levenshtein":"^1.0.0","tiny-parse-argv":"^2.1.2","tiny-updater":"^3.2.2"},"devDependencies":{"@types/node":"^18.13.0","tsex":"^2.0.0","typescript":"^4.9.5"},"gitHead":"6858f41d1a0faebf6ebd6f7084df7ecfaf1e7d2c","bugs":{"url":"https://github.com/fabiospampinato/tiny-bin/issues"},"homepage":"https://github.com/fabiospampinato/tiny-bin#readme","_id":"tiny-bin@1.0.2","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-TSoy3KV3MBiIQcuy/6xKWNR2z1qpOjwjcwN85rU5MQavOr6k5Y6A8lAzbK+WrvyvlsoiwLrIwnfY0Stn5buyEg==","shasum":"82fda0b3bdca06bd266289dc40a25f78d90bb92e","tarball":"http://registry-npm.ywwl.com/tiny-bin/download/tiny-bin-1.0.2.tgz","fileCount":71,"unpackedSize":233591,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrC68jw4VBV73nMLgtzjCyMoWgqYrVzgBAx6LeWme7QAIhAI727ayKGdwuk7LTqHK/z50O7X1k5Wl+vg1wr/P6Kgdk"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5nO1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoxFw/+JnrmWb6Z0xBGZ0gMB91RPP/QlImNMXvYk1v8MJw+RAwmAXlm\r\nAqHKnUTHUqbVjbhDVjkQtL/UT2+PAslD8wlRe4XiuWl6EZY+sECAtmDTy20E\r\nl/gSxixkQ0zvBYLkrQ/0G4qVS+HUDLlBIXXkPdSyHM8E+Htk3GIlKPSQLe6d\r\nG5654sKk9BsBDV97g+hJNB5PWyvXEgPvoxZebzH+RFVoIEXbHGq6rIm9qfh9\r\ntM13Pz3Xni4jnU2QMulWttxOqryhw7Jl0tGZRK3iVOjOKY/soB2SdY9v3w9+\r\nETcEpkkV1igM1tNkAT92AlXPXlYNSqyYHBNiPTCJBODf5ER8jK/aSe0HFG1q\r\nCTfUgnDEC8E6+f3ypaDliqUMqp8lRglvP+MjnDkUt4xoSRkcEOvqJ6RlmFN8\r\nyxeXT2vrZTndAbtQe/wPSEDWTMK3aoMCbvt6QepIzSUSP2KAwVqdy72/3ko9\r\npUNMhiYIc6QPTX32mfe0mBeJCq+Ly9Zx6IFx06nYyDVmm6tIz+TjuRvu+AT3\r\nPliiGb2kOAlehZNAbvc80ALlM+6ATPJMuzd/SFa1Zfps+DpZiXC3NjYAekUU\r\ntMYtN2FLS0USONZeuBmu2zzz4gNpRfaGaPLc8v85tSUSeCofq9qWTQ5RuOym\r\nWFoJguADZ3h26PbRUDo8A0S1YhTwR7EOFVU=\r\n=3aGU\r\n-----END PGP SIGNATURE-----\r\n","size":172694,"noattachment":false,"key":"/tiny-bin/-/tiny-bin-1.0.2.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tiny-bin_1.0.2_1676047285327_0.6275204784818884"},"_hasShrinkwrap":false,"readme":"\n<p align=\"center\">\n  <img src=\"./resources/demo.png\" alt=\"Demo app\" width=\"681px\">\n</p>\n\n# Tiny Bin\n\nA library for building tiny and beautiful command line apps.\n\n## Features\n\nAt a high level this package provides:\n\n- A tiny library, that has no third-party dependencies, that can be bundled, for great startup performance.\n- Beautiful colored and detailed help pages. Colors can be turned off also.\n- Automatic update notifications, that will notify the user of an update right before exiting.\n- Automatic package name and version detection, so you don't even need to provide those.\n- Automatic typo detection, it will suggest the closest command/option if you mistype one.\n- Automatic `help` and `--help` handling, both for the bin and for each command.\n- Automatic `--version` and `-v` handling.\n- Automatic `--no-color` and `--no-colors` handling.\n\nThis library has 5 primitives, bins, commands, options, arguments and actions:\n\n- Bin:\n  - A bin is the entry point of your command line app, you can define multiple bins.\n  - Each bin has a name, a description, and a few built-in commands (default, help, version).\n  - Each bin can have multiple custom commands.\n  - The action for the default command is customizable.\n- Command:\n  - A command is the function that will be executed when running your bin.\n  - Each command has a name, a description, and an automatically generated usage example.\n  - Each command can optional have a section, which will be used to group commands in the help page.\n  - Each command can optionally be hidden from the help page.\n  - Each command can optionally have custom usage examples.\n  - Each command can have multiple options.\n  - Each command can have multiple arguments.\n  - Each command has an action, which is your actual function that will called by the command.\n- Option:\n  - An option is a flag that can be passed to your command.\n  - Each option has a name, a description, and an implicit type (boolean or string).\n  - Each option can optional have a section, which will be used to group options in the help page.\n  - Each option can optionally be hidden from the help page.\n  - Each option can optionally be marked as deprecated, causing it to be dimmed in the help page.\n  - Each option can optionally be marked as eager, so it will consume multiple consecutive values.\n  - Each option can optionally be marked as incompatible with some others.\n  - Each option can optionally be marked as required, so the library will error if it's not provided.\n  - Each option can optionally have a default value.\n  - Each option can optionally have an explicit list of allowed values.\n  - Each option can have multiple longhands (e.g. `--foo`) and multiple shorthands (e.g. `-f`).\n  - Each provided longhand and shorthand for an option is automatically aliased to all the others.\n  - Each non-boolean option must receive at least one value.\n  - Each variadic option can receive multiple values (e.g. `<values...>`).\n- Argument:\n  - An argument is a value that can be passed to your command.\n  - Each argument has a name and a description.\n  - Each argument can be marked as required, so the library will error if it's not provided.\n  - Each variadic argument (e.g. `<args...>`) can receive multiple values.\n- Action:\n  - An action is the function that will be called when running your command.\n  - It will receive the following arguments:\n    - The options object, containing all options for which the library has a value.\n    - The arguments array, contaning an array of strings passed to your command.\n    - The passthrough arguments array, containing an array of strings passed to your command after the special `--` separator.\n\n## Install\n\n```sh\nnpm install --save tiny-bin\n```\n\n## Usage\n\n```ts\nimport bin from 'tiny-bin';\n\nbin ( 'gitman', 'A simple yet powerful opinionated tool for managing repositories' )\n  /* BIN OPTIONS */\n  .colors ( false ) // Turn off colored output\n  .package ( '@fabiospampinato/gitman', '1.2.3' ) // Set the package name and version number manually\n  .autoExit ( false ) // Turn off the automatic process.exit call after action execution\n  .autoUpdateNotifier ( false ) // Turn off the automatic update notifier\n  /* GLOBAL COMMAND OPTIONS */\n  .option ( '--silent, -s', 'Silence all output' )\n  .option ( '--verbose, -V', 'Verbose output' )\n  .option ( '--provider, -p <provider>', 'The provider to use', { default: 'github', enum: ['github', 'gitlab'] } )\n  .option ( '--token, -t <token>', 'GitHub/GitLab personal access token', { required: true } )\n  /* DEFAULT COMMAND ARGUMENTS */\n  .argument ( '[user]', 'The name of the user' )\n  .argument ( '<repo>', 'The name of the repository' )\n  /* DEFAULT COMMAND ACTION */\n  .action ( ( options, args, passthroughArgs ) => {\n    console.log ( 'Default command executed' );\n    console.log ( options );\n    console.log ( args );\n    console.log ( passthroughArgs );\n  })\n  /* CUSTOM COMMAND */\n  .command ( 'clone', 'Clone a repository' )\n  /* CUSTOM COMMAND OPTIONS */\n  .option ( '--submodules', 'Clone submodules too' )\n  /* CUSTOM COMMAND ARGUMENTS */\n  .argument ( '[user]', 'The name of the user' )\n  .argument ( '<repo>', 'The name of the repository' )\n  /* CUSTOM COMMAND ACTION */\n  .action ( ( options, args, passthroughArgs ) => {\n    console.log ( 'Clone command executed' );\n    console.log ( options );\n    console.log ( args );\n    console.log ( passthroughArgs );\n  })\n  /* EXECUTING THE BIN */\n  .run ();\n```\n\n## License\n\nMIT © Fabio Spampinato\n","publish_time":1676047285551,"_cnpm_publish_time":1676047285551,"dist-tags":{"latest":"2.0.1"}}