[{"data":1,"prerenderedAt":199},["ShallowReactive",2],{"term-s\u002Fsync":3,"related-s\u002Fsync":185},{"id":4,"title":5,"acronym":6,"body":7,"category":166,"description":167,"difficulty":168,"extension":169,"letter":170,"meta":171,"navigation":172,"path":173,"related":174,"seo":179,"sitemap":180,"stem":183,"subcategory":6,"__hash__":184},"terms\u002Fterms\u002Fs\u002Fsync.md","Sync",null,{"type":8,"value":9,"toc":160},"minimark",[10,15,19,23,26,30,149,153,156],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18],"p",{},"Sync means one thing at a time, in order. You order food, stare at the kitchen wall, and only get to sit down when the food arrives. Simple and predictable, but you're stuck waiting for each thing to finish before moving on.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"Synchronous code executes sequentially — each operation blocks until it completes before the next one starts. Simple and easy to reason about, but it can freeze the entire program while waiting for slow operations like file reads or network calls.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Synchronous — blocks until file is read\nconst fs = require(\"fs\");\nconst data = fs.readFileSync(\"file.txt\", \"utf-8\");\nconsole.log(data); \u002F\u002F only runs after file is fully read\n","javascript","",[38,39,40,49,86,129],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,48],{"class":47},"sHwdD","\u002F\u002F Synchronous — blocks until file is read\n",[41,50,52,56,60,64,68,71,74,78,80,83],{"class":43,"line":51},2,[41,53,55],{"class":54},"spNyl","const",[41,57,59],{"class":58},"sTEyZ"," fs ",[41,61,63],{"class":62},"sMK4o","=",[41,65,67],{"class":66},"s2Zo4"," require",[41,69,70],{"class":58},"(",[41,72,73],{"class":62},"\"",[41,75,77],{"class":76},"sfazB","fs",[41,79,73],{"class":62},[41,81,82],{"class":58},")",[41,84,85],{"class":62},";\n",[41,87,89,91,94,96,99,102,105,107,109,112,114,117,120,123,125,127],{"class":43,"line":88},3,[41,90,55],{"class":54},[41,92,93],{"class":58}," data ",[41,95,63],{"class":62},[41,97,98],{"class":58}," fs",[41,100,101],{"class":62},".",[41,103,104],{"class":66},"readFileSync",[41,106,70],{"class":58},[41,108,73],{"class":62},[41,110,111],{"class":76},"file.txt",[41,113,73],{"class":62},[41,115,116],{"class":62},",",[41,118,119],{"class":62}," \"",[41,121,122],{"class":76},"utf-8",[41,124,73],{"class":62},[41,126,82],{"class":58},[41,128,85],{"class":62},[41,130,132,135,137,140,143,146],{"class":43,"line":131},4,[41,133,134],{"class":58},"console",[41,136,101],{"class":62},[41,138,139],{"class":66},"log",[41,141,142],{"class":58},"(data)",[41,144,145],{"class":62},";",[41,147,148],{"class":47}," \u002F\u002F only runs after file is fully read\n",[11,150,152],{"id":151},"when-youll-hear-this","When You'll Hear This",[16,154,155],{},"\"That's a sync call — it'll block the event loop.\" \u002F \"Use async operations for I\u002FO — sync only makes sense for startup config loading.\"",[157,158,159],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":51,"depth":51,"links":161},[162,163,164,165],{"id":13,"depth":51,"text":14},{"id":21,"depth":51,"text":22},{"id":28,"depth":51,"text":29},{"id":151,"depth":51,"text":152},"general","Sync means one thing at a time, in order. You order food, stare at the kitchen wall, and only get to sit down when the food arrives.","beginner","md","s",{},true,"\u002Fterms\u002Fs\u002Fsync",[175,176,177,178],"Async","Thread","Concurrency","Pure Function",{"title":5,"description":167},{"changefreq":181,"priority":182},"weekly",0.7,"terms\u002Fs\u002Fsync","J9uqs2NSqpNl5eVe_4rJzcm2rTzQB1oNoG5LOAlqM6s",[186,190,193,196],{"title":175,"path":187,"acronym":6,"category":166,"difficulty":188,"description":189},"\u002Fterms\u002Fa\u002Fasync","intermediate","Async means 'don't wait around'. You order food at a restaurant, then chat with friends instead of standing at the kitchen window staring.",{"title":177,"path":191,"acronym":6,"category":166,"difficulty":188,"description":192},"\u002Fterms\u002Fc\u002Fconcurrency","Concurrency is juggling multiple tasks at once — not necessarily at the exact same instant, but switching between them fast enough that they all seem to be...",{"title":178,"path":194,"acronym":6,"category":166,"difficulty":188,"description":195},"\u002Fterms\u002Fp\u002Fpure-function","A pure function is the well-behaved kid of programming.",{"title":176,"path":197,"acronym":6,"category":166,"difficulty":188,"description":198},"\u002Fterms\u002Ft\u002Fthread","A thread is a mini-worker inside your program that can run tasks independently.",1776518316944]