Skip to content

Commit 49e92d1

Browse files
jebsynshajigur69
andcommitted
Add index.js
Co-authored-by: Hajigur <66867581+hajigur69@users.noreply.github.com>
1 parent 392436e commit 49e92d1

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

src/index.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// src/index.js
2+
/**
3+
* Main entry point for ViewLumen
4+
*/
5+
6+
const { ViewLumen } = require('./viewlumen');
7+
const minimist = require('minimist');
8+
9+
const args = minimist(process.argv.slice(2), {
10+
boolean: ['verbose', 'help'],
11+
alias: {
12+
v: 'verbose',
13+
h: 'help',
14+
i: 'input',
15+
o: 'output'
16+
}
17+
});
18+
19+
async function main() {
20+
try {
21+
if (args.help) {
22+
console.log('Usage: node src/index.js [options]');
23+
console.log('Options:');
24+
console.log(' -v, --verbose Enable verbose logging');
25+
console.log(' -i, --input Input file path');
26+
console.log(' -o, --output Output file path');
27+
console.log(' -h, --help Show this help message');
28+
process.exit(0);
29+
}
30+
31+
const app = new ViewLumen({
32+
verbose: args.verbose || false
33+
});
34+
35+
if (args.verbose) {
36+
console.log('Starting ViewLumen processing...');
37+
}
38+
39+
const result = await app.execute();
40+
41+
if (args.output) {
42+
console.log(`Results saved to: ${args.output}`);
43+
}
44+
45+
console.log('✅ Processing completed successfully');
46+
process.exit(0);
47+
} catch (error) {
48+
console.error('❌ Error:', error.message);
49+
if (args.verbose) {
50+
console.error(error.stack);
51+
}
52+
process.exit(1);
53+
}
54+
}
55+
56+
if (require.main === module) {
57+
main();
58+
}

0 commit comments

Comments
 (0)