check-content
Version:
A tool for evaluating content against content standards.
59 lines (48 loc) ⢠1.83 kB
JavaScript
const chalk = require('chalk');
const path = require('path');
function showInstallationSuccess() {
console.log('');
console.log(chalk.green('š check-content installed successfully!'));
console.log('');
console.log(chalk.bold('Quick Start:'));
console.log(chalk.gray(' # Analyze current directory'));
console.log(chalk.cyan(' check-content -i .'));
console.log('');
console.log(chalk.gray(' # Analyze specific folder'));
console.log(chalk.cyan(' check-content -i ./src'));
console.log('');
console.log(chalk.gray(' # Save with custom filename (skips prompt)'));
console.log(chalk.cyan(' check-content -i ./src --output my-report.md'));
console.log('');
console.log(chalk.gray(' # Get help'));
console.log(chalk.cyan(' check-content --help'));
console.log('');
console.log(chalk.yellow('š For more information, visit: https://github.com/yourrepo/check-content'));
console.log('');
}
// Show success message for both global and local installs
if (process.env.npm_config_global === 'true') {
showInstallationSuccess();
} else {
// Enhanced visibility for local installs
const message = `ā
check-content installed locally
Quick Start:
# Analyze current directory
npx check-content -i .
# Analyze specific folder
npx check-content -i ./src
# Save with custom filename (skips prompt)
npx check-content -i ./src --output my-report.md
# Get help
npx check-content --help
š For more information, visit: https://github.com/yourrepo/check-content
š” To see install messages, use: npm install --foreground-scripts
`;
// Output to both stdout and stderr for maximum visibility
console.log(chalk.green(message));
process.stderr.write(message + '\n');
// Force output flush
process.stdout.write('');
process.stderr.write('');
}