@cloud-copilot/iam-data
Version:
31 lines • 775 B
JavaScript
import { readRelativeFile } from './readRelativeFile.js';
let packageCache = undefined;
/**
* Get the package data version
*
* @returns the package data version
*/
async function getPackageData() {
if (!packageCache) {
const packageInfo = await readRelativeFile(['package.json']);
packageCache = packageInfo;
}
return packageCache;
}
/**
* Get the version of the package
*/
export async function iamDataVersion() {
const data = await getPackageData();
return data.version;
}
/**
* Get the date the data was last updated
*
* @returns the date the data was last updated
*/
export async function iamDataUpdatedAt() {
const data = await getPackageData();
return new Date(data.updatedAt);
}
//# sourceMappingURL=version.js.map