UNPKG

@docubook/create

Version:

CLI to create DocuBook projects

20 lines (15 loc) 629 B
#!/usr/bin/env node import { initializeProgram } from "./cli/program.js"; import fs from "fs"; import path from "path"; import { fileURLToPath } from "url"; // Get the directory name of the current module const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); // Read version from package.json const packageJsonPath = path.join(__dirname, '..', 'package.json'); const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')); const VERSION = packageJson.version; // Initialize and parse CLI arguments const program = initializeProgram(VERSION); program.parse(process.argv);