drizzle-init
Version:
minimalist starter template to get started with drizzle-orm
27 lines (20 loc) • 727 B
JavaScript
import fs from 'fs';
import path from 'path';
export const getVersion = async () => {
const packageJsonPath = path.join(process.cwd(), "package.json");
return new Promise((resolve, reject) => {
fs.readFile(packageJsonPath, "utf8", (err, data) => {
if (err) {
return reject(err);
}
try {
const packageJson = JSON.parse(data);
const VERSION = packageJson.version;
const DESC = packageJson.description;
resolve({ version: VERSION, desc: DESC });
} catch (parseErr) {
reject(parseErr);
}
});
});
};