Skip to content

Allow command handler to accept a promise #510

@vjpr

Description

@vjpr

This would allow much easier use of ES7 async/await.

yargs.command('ls', 'List', async function() { ... })

Workaround

Use IIFE.

yargs.command('ls', 'List', function () { (async function() { ... })().then() })

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions