{"id":28409703,"url":"https://github.com/tecnosamba21/samjs","last_synced_at":"2025-08-02T08:41:12.166Z","repository":{"id":290524885,"uuid":"974731845","full_name":"Tecnosamba21/SamJS","owner":"Tecnosamba21","description":"An Open Source in-real-time JavaScript runner with require, multiple console methods and much more!","archived":false,"fork":false,"pushed_at":"2025-06-05T14:23:26.000Z","size":3068,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T03:40:25.935Z","etag":null,"topics":["editor","javascript","javascript-editor","javascript-playground","playground"],"latest_commit_sha":null,"homepage":"https://samjs.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tecnosamba21.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,"zenodo":null}},"created_at":"2025-04-29T08:15:05.000Z","updated_at":"2025-06-05T14:23:28.000Z","dependencies_parsed_at":"2025-04-29T09:50:09.484Z","dependency_job_id":null,"html_url":"https://github.com/Tecnosamba21/SamJS","commit_stats":null,"previous_names":["tecnosamba21/samjs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Tecnosamba21/SamJS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tecnosamba21%2FSamJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tecnosamba21%2FSamJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tecnosamba21%2FSamJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tecnosamba21%2FSamJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tecnosamba21","download_url":"https://codeload.github.com/Tecnosamba21/SamJS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tecnosamba21%2FSamJS/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268355830,"owners_count":24237376,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["editor","javascript","javascript-editor","javascript-playground","playground"],"created_at":"2025-06-02T10:12:11.022Z","updated_at":"2025-08-02T08:41:12.146Z","avatar_url":"https://github.com/Tecnosamba21.png","language":"JavaScript","readme":"![SamJS](icon.png)\n\n# [SamJS](https://samjs.vercel.app)\n\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Tecnosamba21/SamJS)\n\nSamJS is an **Open Source** in-real-time JavaScript runner for\ntesting and prototyping your JS code.\n\n\u003cdetails\u003e\n  \u003csummary\u003e📚 Table of contents\u003c/summary\u003e\n\n- [SamJS](#samjs)\n  - [Functionalities:](#functionalities)\n  - [Import modules](#import-modules)\n  - [Use `fetch`](#use-fetch)\n  - [Use the console methods -\\\u003e `log`, `info`, `warning`, `error`](#use-the-console-methods---log-info-warning-error)\n  - [Change the theme](#change-the-theme)\n    - [Dark mode](#dark-mode)\n    - [Light mode](#light-mode)\n  - [Search packages](#search-packages)\n  - [Share your code](#share-your-code)\n  - [Account](#account)\n    - [Creating an account](#creating-an-account)\n  - [Managing your account](#managing-your-account)\n  - [Save code snippets](#save-code-snippets)\n\n\u003c/details\u003e\n\u003cbr\u003e\n\n![SamJS GUI](GUI.png)\n\n## Functionalities:\n\n- **Instant** run the code when it's modificated\n- **Async functions** like `fetch` or your custom ones\n- **Import libraries** using the `require` method\n- **Code autocomplanation** while you type\n- **Package searching** with access to all npm\n- **Share your code** by a url\n- **Save code snippets** if you log in\n\n## Import modules\n\nYou can **import modules** in your program by using the async method `require`:\n\n```javascript\nrequire(\u003curl\u003e) -\u003e Promise(\u003clibrary\u003e)\n```\n\nAn example importing `random-words`:\n\n```javascript\nconst rw = await require('https://esm.sh/random-words@1.1.2')\nconsole.log(rw['wordList'])\n```\n\n[Open in SamJS 🔌](https://samjs.vercel.app?c=Y29uc3QlMjBydyUyMCUzRCUyMGF3YWl0JTIwcmVxdWlyZSgnaHR0cHMlM0ElMkYlMkZlc20uc2glMkZyYW5kb20td29yZHMlNDAxLjEuMicpJTBBY29uc29sZS5sb2cocnclNUInd29yZExpc3QnJTVEKQ==)\n\n\u003e [!NOTE]\n\u003e You can only import libraries wich use [ECMAScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) modules\n\n## Use `fetch`\n\nYou can also use the method `fetch` in SamJS, for using it correctly, follow this structure:\n\n```javascript\nfetch(\u003curl\u003e)\n    .then(res =\u003e \u003caction\u003e)\n```\n\nOtherwise, you will get an empty object (`{}`) as the response.\n\nAn example calling the *pokeapi*:\n\n```javascript\nfetch('https://pokeapi.co/api/v2/pokemon/ditto')\n   .then(res =\u003e res.json())\n   .then(response =\u003e console.log(response.name)) // Prints 'ditto'\n```\n\n[Open in SamJS 🔌](https://samjs.vercel.app?c=ZmV0Y2goJ2h0dHBzJTNBJTJGJTJGcG9rZWFwaS5jbyUyRmFwaSUyRnYyJTJGcG9rZW1vbiUyRmRpdHRvJyklMEElMjAlMjAlMjAudGhlbihyZXMlMjAlM0QlM0UlMjByZXMuanNvbigpKSUwQSUyMCUyMCUyMC50aGVuKHJlc3BvbnNlJTIwJTNEJTNFJTIwY29uc29sZS5sb2cocmVzcG9uc2UubmFtZSkp)\n\n## Use the console methods -\u003e `log`, `info`, `warning`, `error`\n\nSamJS supports **four different** print methods:\n\n```javascript\nconsole.log('This is a log')\nconsole.info('This is some info')\nconsole.warning('This is a warning')\nconsole.error('This is an error')\n```\n\n[Open in SamJS 🔌](https://samjs.vercel.app?c=Y29uc29sZS5sb2coJ1RoaXMlMjBpcyUyMGElMjBsb2cnKSUwQWNvbnNvbGUuaW5mbygnVGhpcyUyMGlzJTIwc29tZSUyMGluZm8nKSUwQWNvbnNvbGUud2FybmluZygnVGhpcyUyMGlzJTIwYSUyMHdhcm5pbmcnKSUwQWNvbnNvbGUuZXJyb3IoJ1RoaXMlMjBpcyUyMGFuJTIwZXJyb3InKQ==)\n\nThe example in the app:\n\n![Log example](image.png)\n\n## Change the theme\n\nYou can switch between dark and light modes by pressing the theme button:\n\n![Theme switching](image-1.png)\n\n### Dark mode\n\n![Dark mode](DarkMode.png)\n\n### Light mode\n\n![Light mode](image-3.png)\n\n## Search packages\n\nBy using the method `require` you can import packages very easily. And you can look for them easily as well!\n\nJust press the package searching button and a dialog will be displayed:\n\n![Package Saecrhing](./PackageSearching.png)\n\n## Share your code\n\nDo you want to show your code to your friends or team? Just copy the shareable url and send it to them.\n\n![Share your code](./ShareCode.png)\n\n## Account\n\nSamJS has a **completely free** account system that allows you to save your code in snippets. It uses *[Clerk](https://clerk.com)* for the authentication and *[Supabase](https://supabase.com)* for the code storage.\n\n### Creating an account\n\nFor creating an account press the *Log In* button:\n\n![Create an account](./CreateAnAccountButton.png)\n\nYou will be redirected to a Log In page. Press the *Sign Up* link:\n\n![Create an account](./CreateAnAccountLink.png)\n\nWhen clicked, choose one of the three account options:\n\n- **Github**\n- **Google**\n- **Email** (you will have to confirm the email adress)\n\n![alt text](./CreateAnAccountChooseAnOption.png)\n\n## Managing your account\n\nPress the account button (your account avatar) and then *Manage account*:\n\n![Manage your account](./ManageYourAccountButton.png)\n\nWhen pressed, you will see a dialog where you can change your account settings:\n\n![Manage your account dialog](./ManageYourAccountDialog.png)\n\n## Save code snippets\n\n\u003e [!NOTE]\n\u003e You must be **logged in** in order yo use this function, otherwise the access button will be disabled. Also keep in mind that there is a limit of four snippets per account for ensuring everybody to have free space for their snippets.\n\nPress the *code snippets* button and then *Save current code* for saving the code of the editor as a snippet.\n\n![Code snippets](./CodeSnippetsSave.png)\n\nWhen it is uploaded a `section` will appear with the first line of the saved code:\n\n![When saved](./CodeSnippetsSaved.png)\n\nIf you hover the `section` element two buttons will appear:\n\n- **Add to the current code**: for adding the content of the snippet to the editor.\n- **Remove snippet**: for removing the snippet from the list.\n\nAlso, if you click the `section` the code of the editor will be replaced by the content of the snippet.\n\n![Snippet's buttons](./CodeSnippetsButtons.png)\n\n\u003e [!TIP]\n\u003e For adding a title to the snippet add a comment at the beginning of your code with it","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftecnosamba21%2Fsamjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftecnosamba21%2Fsamjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftecnosamba21%2Fsamjs/lists"}