Node.js
Putting it together
Combine all expert topics into a working mini app.
Putting it together: integration report
In the final lesson we combine all four layers into one report. The integrationReport function calls setupProject, nativeAddon, distributedLayer and performanceLayer, joining their results with ' | '.
The report's returned last line is ExpertProject | N-API | OpenTelemetry | --turbofan. This summarizes the whole expert final in one string. The starting code carries all four previous solutions, so the previous lessons' outputs also appear above the new line. You only add the integrationReport function. With cumulative growth, every piece is in place. This lesson is the meeting point of the native addon, distributed tracing and performance engineering groups.
Calling every layer
The integrationReport function takes each layer's identifier field and joins them with ' | '. setupProject().name, nativeAddon().api, distributedLayer().tracing and performanceLayer().flag are the four pieces.
This pattern shows why each layer's object shape had to be consistent. Because every layer returns with an identifier field, the report combines into one chain. Output: ExpertProject | N-API | OpenTelemetry | --turbofan. This summarizes the project's four lessons in one line. In a real expert project this report could be a log line, a health endpoint or a monitoring dashboard. Here the model shows the logic clearly.
Exercise Write the integration report
Take all four previous solutions. Add function integrationReport(). Return setupProject().name + ' | ' + nativeAddon().api + ' | ' + distributedLayer().tracing + ' | ' + performanceLayer().flag. Print console.log(integrationReport()).
Show example solution
function setupProject() {
return { name: 'ExpertProject', version: '1.0' };
}
console.log(setupProject().name);
console.log(setupProject().version);
function nativeAddon() {
return { api: 'N-API', status: 'hazır' };
}
console.log(nativeAddon().api + ': ' + nativeAddon().status);
function distributedLayer() {
return { tracing: 'OpenTelemetry', status: 'hazır' };
}
console.log(distributedLayer().tracing + ': ' + distributedLayer().status);
function performanceLayer() {
return { flag: '--turbofan', status: 'hazır' };
}
console.log(performanceLayer().flag + ': ' + performanceLayer().status);
function integrationReport() {
return setupProject().name + ' | ' + nativeAddon().api + ' | ' + distributedLayer().tracing + ' | ' + performanceLayer().flag;
}
console.log(integrationReport());
Test yourself
-
What does integrationReport do?
- Only calls setupProject
- Only calls nativeAddon
- Returns nothing
- Joins the four layers into one string
Show answer
Joins the four layers into one string — integrationReport combines four layers into one string.
-
Match each piece to its role
- setupProject
- Skeleton
- nativeAddon
- N-API layer
- distributedLayer
- Tracing layer
- performanceLayer
- Flag layer
-
Complete the join separator
return setupProject().name + '____' + nativeAddon().api + ' | ' + distributedLayer().tracing + ' | ' + performanceLayer().flag;
Show answer
return setupProject().name + ' | ' + nativeAddon().api + ' | ' + distributedLayer().tracing + ' | ' + performanceLayer().flag;
Next lesson: Expert section exam