{"id":27166260,"url":"https://github.com/satyamgupta53/java-script-essentials","last_synced_at":"2025-04-09T03:39:02.878Z","repository":{"id":285763132,"uuid":"957320738","full_name":"satyamgupta53/Java-Script-Essentials","owner":"satyamgupta53","description":"Comprehensive JavaScript repository 🌟 covering fundamentals and DOM manipulation 🛠️,  advanced concepts like asynchronous programming ⏳, closures 🎯, and dynamic imports 📦 for seamless development 🚀","archived":false,"fork":false,"pushed_at":"2025-04-02T15:04:31.000Z","size":53,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T15:24:57.174Z","etag":null,"topics":["dom-manipulation","javascript","nodejs","v8-javascript-engine"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/satyamgupta53.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-30T04:13:17.000Z","updated_at":"2025-04-02T15:04:35.000Z","dependencies_parsed_at":"2025-04-02T15:35:09.104Z","dependency_job_id":null,"html_url":"https://github.com/satyamgupta53/Java-Script-Essentials","commit_stats":null,"previous_names":["satyamgupta53/java-script-essentials"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satyamgupta53%2FJava-Script-Essentials","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satyamgupta53%2FJava-Script-Essentials/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satyamgupta53%2FJava-Script-Essentials/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/satyamgupta53%2FJava-Script-Essentials/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/satyamgupta53","download_url":"https://codeload.github.com/satyamgupta53/Java-Script-Essentials/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247974589,"owners_count":21026742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dom-manipulation","javascript","nodejs","v8-javascript-engine"],"created_at":"2025-04-09T03:39:02.345Z","updated_at":"2025-04-09T03:39:02.872Z","avatar_url":"https://github.com/satyamgupta53.png","language":"JavaScript","readme":"## Introduction\n\nNode JS is runtime environment to execute codes on server, based on v8 engine (by google, C++ based) uses JIT compilation, executing codes faster. **Parsing** — creating abstract syntax tree AST, **Interpretation** — Ignition interpreter (keeping hot code, for optimization) to byte codes, **Optimization** — hot code to Turbo Fan compiler (uses inline caching, copy elision), converting into machine code, **De-Optimization** — when assumptions fail, discarding optimized code, Ignition re-interprets and then, compilation. **Garbage Collection** — uses mark-sweep algorithms to mark live variables \u0026 objects, sweeps unused ones. \n\n```jsx\nconsole.log(\"Hello World !\");\nprocess.stdout.write(\"Another way to print\");\nconsole.table({city: [\"jaipur\", \"delhi\"], state: [\"rajasthan\", \"delhi\"]});\n\ntypeof(balance) --\u003e return number (method to find data type)\nconsole.log(`Hello! My name is ${username}`); // string interpolation\n```\n\n**Datatypes** — `string, number, boolean, bigint, undefined, null, Object`.  **Logical operations** — `\u0026\u0026 (and), || (or), !)`. Back ticks allows to use variables in  string.\n\n![image.png](readme-assets/jit_compiler.png)\n\n## Backend with Java Script\n\n### Node JS \u0026 Express JS\n\n`Ngnix` is HTTP web server, we connect this to our `src/` directory, where we have our static web-pages \u0026 backend logic. Also, much of the Node JS is built with asynchronous event-driven architecture with objects like `emitters`. \n\n```jsx\n/* Writing your own server in pure Node JS */\nserver = http.createServer((req, res) =\u003e {\n\tfs.readFile(path.join(__dirname, req.url === '/' ? 'index.html' : `${req.url}`), \n\t\t(err, content) =\u003e {\n\t\t\tif(!err) {\n\t\t\t\tres.writeHead(200, {\"content-type\": \"text/html\"});\n\t\t\t\tres.end(content, \"utf-8\");\n\t\t\t}\n\t})\n});\n\nserver.listen(port=3000, () =\u003e {\n\tconsole.log(\"Server is successfully running on port 3000\");\n});\n\n/* Creating logging functionality */\nclass Logger extends EventEmitter {\n\tlog(message) {'message': {messsage}};\n}\n\nsetInterval(() =\u003e {\n  const memoryUsage = (os.freemem() / os.totalmem()) * 100;\n  logger.log(`Current memory usage: ${memoryUsage.toFixed(2)}`);\n}, 3000);\n\nlogger.on(\"message\", logToFile);\n\nconst logToFile = (event) =\u003e {\n  const logMessage = `${new Date().toDateString()} - ${event.message} \\n`;\n  console.log(logMessage);\n  fs.appendFile(logFile, logMessage, (err) =\u003e {\n    if (err) console.error(\"Error writing to the file: \", err);\n  });\n};\n```\n\n### **Database SQL vs NO-SQL**\n\nThey are required to store data persistently, major types includes SQL DB and NO-SQL DB (not-only SQL). We need Object-Relational Mapper ORM like `mongoose` to communicate with Mongo DB. SQL refers to Structured Query Language.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatyamgupta53%2Fjava-script-essentials","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsatyamgupta53%2Fjava-script-essentials","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsatyamgupta53%2Fjava-script-essentials/lists"}