RepoInfoJS - Simple repository information function
Usage:
const info = await console /* Output: { formatted: 'master-1', branch: 'master', hash: 'b5508f6', hashFull: 'b5508f67e32948b49dcd9b3c2dd1e0afe53bbf89', commits: '1', lastCommit: 'Tue, 4 Sep 2018 00:21:53 +0200', lastCommitRel: '5 days ago' } */
You can pass one additional argument:
getUname
(String|Array) - Passing a string here will cause the output ofuname
to be included as well. E.g. passing'-n'
will rununame -n
and include the output. You can include an array of strings as well.
For example:
const info = await console /* Output: { formatted: 'master-1', branch: 'master', hash: 'b5508f6', hashFull: 'b5508f67e32948b49dcd9b3c2dd1e0afe53bbf89', commits: '1', lastCommit: 'Tue, 4 Sep 2018 00:21:53 +0200', lastCommitRel: '5 days ago', uname: [ 'Vesuvius.local', 'x86_64' ] } */
This function uses external calls and returns a Promise
. In case of an error, all null
values are returned.
Copyright
MIT license.