{"id":18282157,"url":"https://github.com/vikashpr/js-minicompiler","last_synced_at":"2025-04-09T05:24:13.725Z","repository":{"id":165486685,"uuid":"640850453","full_name":"VikashPR/JS-MiniCompiler","owner":"VikashPR","description":" A mini JavaScript Compiler to compile JavaScript code online. It is a free tool to compile JavaScript code online.","archived":false,"fork":false,"pushed_at":"2023-05-15T09:13:42.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T23:47:13.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://vikashpr.github.io/JS-MiniCompiler/","language":"Sass","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VikashPR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-05-15T09:00:29.000Z","updated_at":"2024-06-18T12:17:47.000Z","dependencies_parsed_at":"2023-06-05T08:15:28.209Z","dependency_job_id":null,"html_url":"https://github.com/VikashPR/JS-MiniCompiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VikashPR%2FJS-MiniCompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VikashPR%2FJS-MiniCompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VikashPR%2FJS-MiniCompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VikashPR%2FJS-MiniCompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VikashPR","download_url":"https://codeload.github.com/VikashPR/JS-MiniCompiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247982599,"owners_count":21028147,"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":[],"created_at":"2024-11-05T13:04:27.787Z","updated_at":"2025-04-09T05:24:13.707Z","avatar_url":"https://github.com/VikashPR.png","language":"Sass","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JS Mini Compiler \n\n\n## Example Usage (Copy paste these example codes in the compiler input box)\n\n![Screenshot 2023-05-15 at 2 40 48 PM](https://github.com/VikashPR/JS-MiniCompiler/assets/69889418/b9eb3c24-1669-4462-9461-39649e9ba3af)\n\n### Reverses a string\n\n``` js\n\nfunction reverseString(str) {\n    let reversedString = '';\n    for (let i = str.length - 1; i \u003e= 0; i--) {\n        reversedString += str[i];\n    }\n    return reversedString;\n}\n\nlet reversedString = reverseString(\"Hello World!\");\nconsole.log(reversedString);\n```\n\n### Sorting of an array of numbers using selection sort algorithm\n\n```js\nvar array = [];\n\nfunction getArrayFromUser() {\n  alert(\"Enter the elements of the array, separated by commas:\");\n  var input = prompt();\n  var elements = input.split(\",\");\n  for (var i = 0; i \u003c elements.length; i++) {\n    array.push(elements[i]);\n  }\n}\n\nfunction sortArray() {\n  var sortedArray = [];\n  while (array.length \u003e 0) {\n    var minValue = array[0];\n    var minIndex = 0;\n    for (var i = 1; i \u003c array.length; i++) {\n      if (array[i] \u003c minValue) {\n        minValue = array[i];\n        minIndex = i;\n      }\n    }\n    sortedArray.push(minValue);\n    array.splice(minIndex, 1);\n  }\n  return sortedArray;\n}\n\ngetArrayFromUser();\nvar sortedArray = sortArray();\nconsole.log(\"The sorted array is: \" + sortedArray);\n\n```\n\n### Identifying a number as prime or not\n\n```js\nfunction isPrime(n) {\n  for (var i = 2; i \u003c= Math.sqrt(n); i++) {\n    if (n % i === 0) {\n      return false;\n    }\n  }\n  return true;\n}\n\nfunction getNumberFromUser() {\n  alert(\"Enter a number:\");\n  var input = prompt();\n  return parseInt(input);\n}\n\nvar number = getNumberFromUser();\nvar isPrime = isPrime(number);\n\nif (isPrime) {\n  alert(number + \" is a prime number\");\n} else {\n  alert(number + \" is not a prime number\");\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikashpr%2Fjs-minicompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvikashpr%2Fjs-minicompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikashpr%2Fjs-minicompiler/lists"}