Simple utility which combines, git, package and build creation info into one.
Type: Object?
- Type:
Arrayoptions.pack - getBuildTimeAsync args - Type:
Arrayoptions.build - getBuildTimeAsync args - Type:
Arrayoptions.os - getOs args
Promise<Object> of { pack, git, build, os } information.
Returns the creation Date of the specified file.
Type: String
Promise<Date>
buildInfoAsync({
build: [path.join(__dirname, 'index.js')],
pack: [path.join(__dirname, '..', 'package.json')],
}).then(console.log);
/*
{ pack: { name: '@znemz/build-info', version: '0.0.1' },
git:
{ branch: 'master',
commit: '7f84cea66d5faf8c14000bd34a130ce730f68bde',
tag: TagList { latest: undefined, all: [] } },
build: 2019-06-05T20:54:50.983Z,
os: 'macOS Mojave 10.14, Darwin: 18.6.0' }
*/Returns the json object info for the specified package.json.
Type: String
Type: Array<String>? - able to specify which fields to return. Defaults to ['name', 'version'].
Promise<Object>
Returns the git current commit, branch, and tag info.
Promise<Object> - { commit, branch, tag }
getGitAsync().then(console.log);
// { branch: 'master',
// commit: '7f84cea66d5faf8c14000bd34a130ce730f68bde',
// tag: TagList { latest: undefined, all: [] } }Returns detailed OS information. Combines os-name, macos-release, and os libs into one.
Type: Array<any>
Type: string - specify a specific release, for mac-release.
String - OS info name + release
getOS();
// macOS Mojave 10.14, Darwin: 18.6.0