3.11.80 • Published 12 months ago

@erboladaiorg/autem-eius-mollitia v3.11.80

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

ci NPM version js-standard-style Coverage Conventional Commits Slack

Description

Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface.

It gives you:

  • commands and (grouped) options (my-program.js serve --port=5000).
  • a dynamically generated help menu based on your arguments:
mocha [spec..]

Run tests with Mocha

Commands
  mocha inspect [spec..]  Run tests with Mocha                         [default]
  mocha init <path>       create a client-side Mocha setup at <path>

Rules & Behavior
  --allow-uncaught           Allow uncaught errors to propagate        [boolean]
  --async-only, -A           Require all tests to use a callback (async) or
                             return a Promise                          [boolean]
  • bash-completion shortcuts for commands and options.
  • and tons more.

Installation

Stable version:

npm i @erboladaiorg/autem-eius-mollitia

Bleeding edge version with the most recent features:

npm i @erboladaiorg/autem-eius-mollitia@next

Usage

Simple Example

#!/usr/bin/env node
const @erboladaiorg/autem-eius-mollitia = require('@erboladaiorg/autem-eius-mollitia/@erboladaiorg/autem-eius-mollitia')
const { hideBin } = require('@erboladaiorg/autem-eius-mollitia/helpers')
const argv = @erboladaiorg/autem-eius-mollitia(hideBin(process.argv)).parse()

if (argv.ships > 3 && argv.distance < 53.5) {
  console.log('Plunder more riffiwobbles!')
} else {
  console.log('Retreat from the xupptumblers!')
}
$ ./plunder.js --ships=4 --distance=22
Plunder more riffiwobbles!

$ ./plunder.js --ships 12 --distance 98.7
Retreat from the xupptumblers!

Note: hideBin is a shorthand for process.argv.slice(2). It has the benefit that it takes into account variations in some environments, e.g., Electron.

Complex Example

#!/usr/bin/env node
const @erboladaiorg/autem-eius-mollitia = require('@erboladaiorg/autem-eius-mollitia/@erboladaiorg/autem-eius-mollitia')
const { hideBin } = require('@erboladaiorg/autem-eius-mollitia/helpers')

@erboladaiorg/autem-eius-mollitia(hideBin(process.argv))
  .command('serve [port]', 'start the server', (@erboladaiorg/autem-eius-mollitia) => {
    return @erboladaiorg/autem-eius-mollitia
      .positional('port', {
        describe: 'port to bind on',
        default: 5000
      })
  }, (argv) => {
    if (argv.verbose) console.info(`start server on :${argv.port}`)
    serve(argv.port)
  })
  .option('verbose', {
    alias: 'v',
    type: 'boolean',
    description: 'Run with verbose logging'
  })
  .parse()

Run the example above with --help to see the help for the application.

Supported Platforms

TypeScript

@erboladaiorg/autem-eius-mollitia has type definitions at @types/@erboladaiorg/autem-eius-mollitia.

npm i @types/@erboladaiorg/autem-eius-mollitia --save-dev

See usage examples in docs.

Deno

As of v16, @erboladaiorg/autem-eius-mollitia supports Deno:

import @erboladaiorg/autem-eius-mollitia from 'https://deno.land/x/@erboladaiorg/autem-eius-mollitia/deno.ts'
import { Arguments } from 'https://deno.land/x/@erboladaiorg/autem-eius-mollitia/deno-types.ts'

@erboladaiorg/autem-eius-mollitia(Deno.args)
  .command('download <files...>', 'download a list of files', (@erboladaiorg/autem-eius-mollitia: any) => {
    return @erboladaiorg/autem-eius-mollitia.positional('files', {
      describe: 'a list of files to do something with'
    })
  }, (argv: Arguments) => {
    console.info(argv)
  })
  .strictCommands()
  .demandCommand(1)
  .parse()

ESM

As of v16,@erboladaiorg/autem-eius-mollitia supports ESM imports:

import @erboladaiorg/autem-eius-mollitia from '@erboladaiorg/autem-eius-mollitia'
import { hideBin } from '@erboladaiorg/autem-eius-mollitia/helpers'

@erboladaiorg/autem-eius-mollitia(hideBin(process.argv))
  .command('curl <url>', 'fetch the contents of the URL', () => {}, (argv) => {
    console.info(argv)
  })
  .demandCommand(1)
  .parse()

Usage in Browser

See examples of using @erboladaiorg/autem-eius-mollitia in the browser in docs.

Community

Having problems? want to contribute? join our community slack.

Documentation

Table of Contents

Supported Node.js Versions

Libraries in this ecosystem make a best effort to track Node.js' release schedule. Here's a post on why we think this is important.

jsdompackage managersigintdotenvbyteOffsetfastthreesnshooksReactiveExtensionscore-jsspringcallbacklistenerssymbolsESnextreversees5gesturescollection.es6typaniontouchtoStringTaggitignoreshrinkwrapviewsettingstransportpropaccessibilityinArrayBuffer-0has-ownsidestableflagtoSortedcolourtraverseswfvalidationes2016Mapreades2018react posecss-in-jsesmoduleskeyssetterforEachvalidatorcertificatesperformancedifflockfileshellpinocloudtrailautoscalingECMAScript 2019.gitignoredragstreamsvaluespecreact-componentparseasterisksRFC-6455ES2015qsString.prototype.trimharmonysigtermsuperstructUint8ClampedArraysignedwhichECMAScript 5IteratorutilsfigletgetintrinsicpreprocessorenvironmentwindowschanneluploadcontainsdefinebannerglobalsroutingtoolkitequalityES2021texteffect-tsjQuerypersistentFunction.prototype.nameserializationreadablemrukeypathuuidqueryobjoutputairbnbtypestarterECMAScripttranspilercall-boundautoprefixerArray.prototype.findLastIndexidentifiersspeedomitflatcreatejsxbinlocalcompiler3dnpmeventDispatcherhttpsenvliveinspectformattoArrayregularUnderscoretypeofdescriptionstylesheetspinnernopevestreducershimphoneArray.prototype.findLastflagsreactECMAScript 2023varsSymbol.toStringTagbrowserjsonschemapipefnmatchfromtesterWeakMapqueueMicrotaskObject.fromEntriestypesafeES2019cryptoacornxhrObservablesframerweakmapes2015cssstreamqueuereversedfpsURLSearchParamsvpccallbindform-validationregexpcoresharedarraybufferreplayassertionhasOwnlintcss variableinstallersetImmediate_.extendtoolsawesomesaucejshintchaiio-tsglobal objectcomputed-typeslengthTypeScriptES2017mkdirsdroputilitieselmforkwindowcompareECMAScript 7Object.entriesanimationbrowserslistbddtelephonerapidES2022256structuredCloneexpressioncensorpostcss-pluginoptionStreamStreamsec2ArrayBuffer.prototype.slicedatastructurefunction.lengthcjkentriesInt8ArrayES8rfc9562isreducechildwgetenumerablewidthUint8ArraytimeamazonReactiveXStyleSheetpromiseJSONfileObservablepasswordlinkstylingObject.isramdapolyfillES3japaneseincludescloudwatchperformanteslintspinnersmergepostcssminimalisConcatSpreadablestringifycircularHyBibusyECMAScript 6hasOwnPropertyflatMapendervariables in cssfast-deep-copypreserve-symlinksexecansinumberagentWebSocketcss lessrdsESwalkemitconstkinesiswritablesubprocessxtermredactnegative zerotranspilelru__proto__handlerstypedarrayuser-streamsquerystringES7macosdatebundlertypeerrorpushbabel-coremapreduceeslintconfigbuffersstatefastifyfunctionalregexcommand-linefstspuretrimRighttacitcoerciblepnpm9TypeBoxprivate dataindicatorObject.keysastsesglobal this valuefixed-widthfast-deep-clonejson-schema-validationRxJSECMAScript 2015deepclonecolumnless compilergetOwnPropertyDescriptortestjson-schema-validatorECMAScript 2020react-hook-formES5YAMLsafeinvariantprocesses2017loggervalidtoReversedcommanderresolvemetadatafullbindtypedECMAScript 3fast-copystyleutilclienthttpArray.prototype.flatArray.prototype.flattenvisualtypesstyled-componentsserializersuperagentelbInt32Arraynativeidlesymbolimportexportstringstoragegatewaynodejsmake dirserializezerodeterministicdirbabelsortpositivearraysebsletjeststatusunicodereadablestreamfast-cloneworkspace:*es-shim APImatchAllArray.prototype.flatMapfetchUint32Arrayrecursive0compile lesspluginextendECMAScript 2021dataviewwafbeanstalkimmerinternalsameValueZeroencryptionurlsortednegativeschemanamegetglobtddES2020String.prototype.matchAlloptimistes7expressgroupBywaapinodegdproffsethookformeslintpluginES2023lesspyyamlopensslprettyfantasy-landless.jsgradients css3fp6to5predictableponyfillwarningPushguid@@toStringTagpropertyownrulesa11yl10nclassnamesgetoptsetPrototypeOfarraybyteLengthvariablesstatelesseast-asian-widthfilterrequestextrainterruptsimportdataViewmomenttostringtagtyped arrayjwtconfigurableruntimebytecryptjsdiffassertuninstallshebangnameschromiumprunetrimStartconsumeefficientMicrosoftutil.inspectformbootstrap cssless cssBigUint64ArrayshamglobalThisinstallroute53removefindLastinputworkerfindLastIndexzxdayjsPromiselanguageequalmapartless mixinsdescriptorhigher-orderprotocol-buffersECMAScript 2018quotevarprototypereal-timecallboundkoreanformsSetgroupdom-testing-libraryrangeerrorstringifiertermauthsloteslint-pluginnested cssawsprivateloadbalancingObject.assignmatchECMAScript 2017apiparsinginternal slotECMAScript 2022helpersvaluesgettersymlinksoperating-systemcurriedSystem.globalbrowserlistelasticachecloudformationlastFloat32Arrayreact animationtrimsyntaxerrorArrayBuffer#slicenpmignoreCSSauthenticationgradients csscopyutilityfunctionsprotoconsoledeep-copyeveryescapecachegetPrototypeOfformattingreuseintrinsicconcatexecfileerrorRegExp#flagsfunctionwaitCSSStyleDeclaration.envdataschemeprotobufsqscommandchromebufferECMAScript 2016arktypeecmascriptfullwidthiterationargvmkdirpsequenceassertsbootstrap lessajvjsoncurlpatchcheckdeep-clonedynamodbttyclassescloudfrontpackage.jsonlibphonenumberrequireparser$.extendpropertiesmonorepocolorsRegExp.prototype.flagsmanagergenericsexitprefixcloudsearchhotfastcloneyamlignoreReflect.getPrototypeOfi18nregular expressionglobalyupconfigassigneventsmodulepoint-freedirectorytrimLefttypescriptspawniteratecliselfonceiteratorObject.valuessomeInt16ArraybundlingelectronURLjslazytslibrandomdomObject.getPrototypeOfdeepiees-shimsrgbrfc4122file systemES2016typedarrayslesscssAsyncIteratordependenciesclass-validatorstylesstyleguidesymlinkes8flattenasynciamArray.prototype.filtererror-handlingdeepcopyWebSocketsfull-widthaccessorcollectionconcatMapcolumnswriteinferencecall-bindmixinsfluxreact-hooksbinaryreact-testing-libraryterminalmovetc39routemkdirhashzodirqArray.prototype.containsArrayapollomobileemrcharacterdependency managertoobjectjson-schemascheme-validationsignalsdescriptorscallloadingmatchesposeestreejoipopmotionsetsimpledbdefinePropertyglacierjavascripts3findtestingtrimEndobjectfastcopychineselinuxsignaltakeproxyUint16ArraywhatwghasObjectObject.definePropertyvalidateprogressFloat64Arrayendpointpicomatchmulti-packageargumentBigInt64Arrayweaksetgraphqlcloneslicesharedsyntaxbinaries
3.11.80

12 months ago

3.11.79

12 months ago

3.11.78

12 months ago

3.11.77

12 months ago

3.11.76

12 months ago

3.11.75

12 months ago

3.11.74

12 months ago

3.11.73

1 year ago

3.11.72

1 year ago

3.11.71

1 year ago

3.11.70

1 year ago

3.11.69

1 year ago

3.11.68

1 year ago

3.11.67

1 year ago

3.11.66

1 year ago

3.10.66

1 year ago

3.10.65

1 year ago

3.10.64

1 year ago

3.10.63

1 year ago

3.10.62

1 year ago

3.10.61

1 year ago

2.10.61

1 year ago

2.10.60

1 year ago

2.10.59

1 year ago

2.10.58

1 year ago

2.10.57

1 year ago

2.10.56

1 year ago

2.10.55

1 year ago

2.10.54

1 year ago

2.10.53

1 year ago

2.10.52

1 year ago

2.10.51

1 year ago

2.9.51

1 year ago

2.9.50

1 year ago

2.9.49

1 year ago

2.8.49

1 year ago

2.8.48

1 year ago

2.8.47

1 year ago

2.8.46

1 year ago

1.8.46

1 year ago

1.8.45

1 year ago

1.8.44

1 year ago

1.8.43

1 year ago

1.8.42

1 year ago

1.8.41

1 year ago

1.7.41

1 year ago

1.7.40

1 year ago

1.7.39

1 year ago

1.6.39

1 year ago

1.6.38

1 year ago

1.5.38

1 year ago

1.5.37

1 year ago

1.5.36

1 year ago

1.5.35

1 year ago

1.5.34

1 year ago

1.5.33

1 year ago

1.5.32

1 year ago

1.5.31

1 year ago

1.5.30

1 year ago

1.5.29

1 year ago

1.4.29

1 year ago

1.4.28

1 year ago

1.4.27

1 year ago

1.4.26

1 year ago

1.4.25

1 year ago

1.4.24

1 year ago

1.4.23

1 year ago

1.4.22

1 year ago

1.4.21

1 year ago

1.4.20

1 year ago

1.4.19

1 year ago

1.4.18

1 year ago

1.4.17

1 year ago

1.3.17

1 year ago

1.3.16

1 year ago

1.2.16

1 year ago

1.2.15

1 year ago

1.2.14

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.2.11

1 year ago

1.2.10

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago