Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/milafrerichs/browser-repl-js
A Javascript REPL (code editor and code results) component using svelte
https://github.com/milafrerichs/browser-repl-js
javascript repl svelte svelte-components
Last synced: 3 months ago
JSON representation
A Javascript REPL (code editor and code results) component using svelte
- Host: GitHub
- URL: https://github.com/milafrerichs/browser-repl-js
- Owner: milafrerichs
- Created: 2019-06-16T10:11:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-03T13:52:50.000Z (almost 2 years ago)
- Last Synced: 2024-06-12T18:03:38.177Z (5 months ago)
- Topics: javascript, repl, svelte, svelte-components
- Language: HTML
- Homepage: https://javascript-tutorials.milafrerichs.now.sh/
- Size: 597 KB
- Stars: 14
- Watchers: 1
- Forks: 2
- Open Issues: 23
-
Metadata Files:
- Readme: Readme.md
- Changelog: Changelog.md
Awesome Lists containing this project
README
# Browser REPL JS
The idea is to have a code editor where you can put in code or there is code prefilled and you see the result of the code and can edit the code.
## Motivation
I give plenty of workshops with d3 and I used Codebin or similar tools in the past, but they have their downsides. There are not integrated with your website and take long to load. Sometime with these workshops the internet connection is not good, and I need an offline alternative.
I tried observable which is great for d3 and you can for the code and try it out yourself. But ypu need to learn the observable way before you can learn d3 and it only works with internet.That's why I built the prototype in a day to test it out.
## Usage outside a svelte app
```
new JavascriptRepl({
target: document.querySelector('#code-example'),
props: {
files: [{name: 'index.js', content: code, type: 'js' }]
}
});
```### Example how it looks like
![](docs/example.png)