1.2.0 • Published 3 years ago
@henryscheible/trieclient v1.2.0
Trie Client
Installation
The client is a Node package hosted on the npm registry, so it can be installed with the following command:
$ npm i -g @henryscheible/trieclient@1.1.0Usage
Help
Usage information can be shown by invoking the --help option:
$ triecli --help
triecli [command]
Commands:
triecli put <keyword> add a keyword to the trie
triecli delete <keyword> delete a keyword from the trie
triecli autocomplete <keyword> find keywords in trie that start with
<keyword>
triecli list list all keywords in the trie
triecli find <keyword> check whether <keyword> is present in trie
Options:
--version Show version number [boolean]
--url the api url to connect to
[string] [default: "http://localhost:8000/"]
--help Show help [boolean]Put Keyword
$ triecli put <keyword>
Successfully added <keyword> to trieFind Keyword
$ triecli find <keyword>This command will print true if the keyword is found and false if the keyword is not found
Delete Keyword
$ triecli delete <keyword>Autocomplete Keyword
$ triecli autocomplete <prefix>This command will print out all keywords starting with <prefix>, each on their own line. Example:
$ triecli autocomplete h
hello
hungryDisplay Trie
$ triecli listThis command will print out all keywords in a trie one line at a time.