@roots/bud
Version:
Configurable, extensible build tools for modern single and multi-page web applications
15 lines (14 loc) • 503 B
JavaScript
import { dirname, join, resolve, sep } from 'node:path';
import { fileURLToPath } from 'node:url';
export const get = async (fs) => {
const resolvedPath = dirname(fileURLToPath(import.meta.url));
const manifestPath = resolve(join(resolvedPath, `..`, `..`, `..`, `package.json`));
const manifest = await fs.read(manifestPath);
const label = manifest.name.split(sep).pop();
const version = manifest.version;
return {
label,
manifestPath,
version,
};
};