1111 < head >
1212
1313 < title >
14- nodejs in webpage
14+ Node.js In Webpage
1515 </ title >
1616
17- < base href ='https://ext-code.com/blog/25-08-17/nodejs-in-webpage/ '>
18- < base href ='https://javascript-2020.github.io/blog/25-08-17/nodejs-in-webpage/ '>
17+ < meta name =desctiption content ='Discover how to run Node.js-like code directly in the browser using WebContainers and other tools. This guide includes a live, editable demo so you can experiment with server-side JavaScript in a webpage—no local setup required. '>
18+
19+ < link rel =icon type ='image/png ' href ='/blog/image/blog-30.png '>
20+ < meta name =viewport content ='width=device-width, initial-scale=1 '>
1921
22+ < base href ='https://ext-code.com/blog/25-08-17/nodejs-in-webpage/ '>
2023 < link rel =canonical href ='https://ext-code.com/blog/25-08-17/nodejs-in-webpage/nodejs-in-webpage.html '>
2124
22- < link rel =icon type ='image/png ' href ='/blog/image/blog-30.png '>
25+
26+ < script type ='application/ld+json '>
27+ {
28+ "@context" : "https://schema.org" ,
29+ "@type" : "TechArticle" ,
30+ "headline" : "Node.js In Webpage" ,
31+ "description" : "Discover how to run Node.js-like code directly in the browser using WebContainers and other tools. This guide includes a live, editable demo so you can experiment with server-side JavaScript in a webpage—no local setup required." ,
32+ "author" : { "@type" :"Person" , "name" :"Matthew Richards" } ,
33+ "datePublished" : "2025-08-17" ,
34+ "dateModified" : "2025-10-29" ,
35+ "mainEntityOfPage" : { "@type" :"WebPage" , "@id" :"https://ext-code.com/blog/25-08-17/nodejs-in-webpage/nodejs-in-webpage.html" } ,
36+ "publisher" : { "@type" :"Organization" , "name" :"Your Blog or Company Name" , "logo" :{ "@type" :"ImageObject" , "url" :"https://ext-code.com/favicon.ico" } } ,
37+ }
38+ </ script >
39+ <!--
40+ "image" : "https://yourdomain.com/images/http2-nodejs-demo.png"
41+ -->
2342
2443
2544 < script src ='https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js '> </ script >
3554
3655 var df = true , version = 'v1.0'
3756 ;
38-
3957
58+
59+ var ace ;
60+
4061 var ext ;
4162 var $ ;
4263 var datatype ;
4364 var menumod ;
44- var code ;
65+ var keydown ;
66+ var debug ;
67+
68+ var menu ;
4569
4670 var snippet ;
4771
72+
73+ var log ;
74+
4875
4976 //:
5077
5178
5279 async function init ( ) {
53- // debug('init',version);
80+ debug ( 'init' , version ) ;
5481 menu = menumod ( ) ;
5582
5683
5784 snippet = mod . ex1 ;
85+ log = mod . log ;
5886
5987 snippet . initmod ( { ext, $, menu, ace} ) ;
88+ log . initmod ( { ext, $} ) ;
6089
61- await snippet . init ( ) ;
90+ await Promise . all ( [
91+ snippet . init ( ) ,
92+ log . init ( ) ,
93+ ] ) ;
6294
6395
64- await initdom ( document . body ) ;
96+ initdom ( document . body ) ;
6597
6698
6799 } //init
81113 'js/core/datatype.js' ,
82114 'js/dom/menumod/menumod.js' ,
83115 'js/dom/keydown/keydown.js' ,
84- 'js/dom/code/v2.0/code-v2.0.js.api' ,
85116 'js/debug/debug.js' ,
86117 ) ;
87- [ $ , datatype , menumod , keydown , code ] = await promise ;
118+ [ $ , datatype , menumod , keydown , debug ] = await promise ;
88119
89- code . initmod ( { ext, $, datatype, menumod} ) ;
90-
91120 mod . stack . complete ;
92121
93122} ) ( ) ;
@@ -159,6 +188,9 @@ <h1 class=title>
159188 < snippet-terminal-console id =ex1 component v2.0 src ='ex/ex1.js '> </ snippet-terminal-console >
160189
161190
191+ < log component v2.0 > </ log >
192+
193+
162194 </ body >
163195
164196
@@ -175,32 +207,25 @@ <h1 class=title>
175207 var root ;
176208
177209
178-
179- async function initdom ( rootnode ) {
210+ //:
211+
212+
213+ function initdom ( rootnode ) {
180214
181215 root = rootnode ;
182216
183217
184- /*
185- var node = $(root,'code-block');
186- ({code_block} = await code.code_block(mod,node,{menu,ace}));
187- console.log(code_block);
188- code_block.snippet_console.snippet.console.height('200px');
189- */
190-
191218 snippet . initdom ( root ) ;
192-
193-
194-
195- //test();
196-
197-
198-
199219
220+
221+ log . initdom ( ) ;
222+
200223 } //initdom
201224
202225
203-
226+ //:
227+
228+
204229 </ script >
205230
206231</ html >
0 commit comments