-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.ts
37 lines (29 loc) · 1.04 KB
/
example.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { AIAReader } from './src/aia_reader';
import fs from "node:fs/promises";
async function main() {
try {
const aiaFile = await fs.readFile('test/fixtures/Test.aia')
const aiaFileBlob = new Blob([aiaFile])
// Create an instance of AIAReader and read the AIA file
const project = await AIAReader.parse(aiaFileBlob);
// Pretty print the parsed information
console.log('Project Information:');
console.log('===================');
console.log(`Name: ${project.name}`);
// Print screens information
console.log('\nScreens:');
console.log('========');
project.screens.forEach(screen => {
console.log(`\nScreen: ${screen.name}`);
});
// Print assets information
console.log('\nAssets:');
console.log('=======');
project.assets.forEach(asset => {
console.log(`- ${asset.name}`);
});
} catch (error) {
console.error('Error parsing AIA file:', error);
}
}
main();