@kli-tool/searcher

0.0.6 • Public • Published

KLI Command Searcher

Accepts an array of commands with a name and aliases, then returns a searcher that can be used to autcomplete and detect which command was intended.

    it('ensure searching for all aliases and names are the same', assert => {
        const subject = searcher({
            commands: [
                {
                    name: 'command',
                    aliases: ['test', 'another'],
                },
            ],
        })
        const name = subject.get('comm')[0]
        const alias1 = subject.get('test')[0]
        const alias2 = subject.get('anot')[0]
        assert.ok(name === alias1 && alias1 === alias2 && alias2 === name)
    })

Readme

Keywords

none

Package Sidebar

Install

npm i @kli-tool/searcher

Weekly Downloads

3

Version

0.0.6

License

MIT

Unpacked Size

2.87 kB

Total Files

4

Last publish

Collaborators

  • raybenefield