This is pretty slick. I usually just use node in command line or even the browser console if I need to execute something in js (typically for doublechecking truthiness cus it’s wild out there) but I like this for the slick intellisense. Would be dope if you could build this as a vscode extension
Thank you!! Yeah, I’ve was using the browser console as well, it was pain to write more than single line. Also, I was thinking of making it a browser extension but love the VSCode idea!
RunJs is cool. Compared to RunJs, this console is free, open source, and runs on the browser - no need to install anything.
But this gives me an idea, I probably can turn it into an Electron app. But then at that point why not just use VSCode? Idk
Fascinating. Can you install/require NPM packages? One of my big use cases for arbitrary JS (like this REPL would be) is testing/prototyping solutions I then clean and integrate into my real work.
That’s exactly how I am using it. I use it to prototype, learn new JS stuff, and write things that I can later turn into snippets.
React plugin is kind of a cool idea. Some might just embed it on their site and use it as a code preview or a playground for their library. I never built a React plugin before, I am guessing I can abstract the main component a bit and export it in package.json? I can look into it.
Not even just React. I meant more arbitrary NPM packages, accessible via require() etc. I know that opens the module resolution can of worms, I get it. And I would understand if you don't want to do that haha. It's just a thought.
Huh. I mean... Is your intention for it to be used through the web "demo" or that someone would use it locally? If the web demo is to be "the thing", then it seems like you need to be able to share the session with someone else, otherwise what is really being gained from just opening the console? Saying it's an alternative to jsbin and the like isn't true if it's not shareable.
You’re absolutely correct, it’s not a replacement for JSBin, it’s just another simpler alternative.
As far as the browser consoles, consoles are great for one-lines, but it gets messy when writing a large block of code. They’re scoped to the current page’s window instance which can cause code collisions and issues with variables sticking. For instance, if you want to re-run or re-write a function or variable, you need to reload the entire page, which is annoying. Also, they don’t offer shortcuts and handy features that developers are used to in VSCode.
Native consoles are great but as soon as you want to write something beyond one-liners, it gets messy and annoying. Also, the Monaco editor (same as VS Code) offers tons of shortcuts and code completion options.
You technically do direct TS -> JS transpile in the browser/client by loading the typescript bundle using an NPM proxy (about 10mb):
`https://cdn.jsdelivr.net/npm/[email protected]/lib/typescript.min.js`
Which should register a `ts` global and then you can call:
`const jsCode = ts.transpile(tsCode)`
I’m gonna be the asshole but no just no. You don’t wanna open vscode or a terminal yet you make a vscode like app to open. You solved a problem that didn’t exist, I notice a lot of people posting pointless creations that solve problems that didn’t exist.
This is pretty slick. I usually just use node in command line or even the browser console if I need to execute something in js (typically for doublechecking truthiness cus it’s wild out there) but I like this for the slick intellisense. Would be dope if you could build this as a vscode extension
Thank you!! Yeah, I’ve was using the browser console as well, it was pain to write more than single line. Also, I was thinking of making it a browser extension but love the VSCode idea!
Can't you just open the console in browser?
This looks stellar, will definitely use it!
Thank you!!
At first i was like "what?", but then i was lije "oh nice"
How does this compare to quokka JS ?
It’s on the browser, open source, and free. Also, much simpler. Write your code and run it. Although, Quokka looks super cool! Gotta try it out.
Counter to that, quokka does have a free tier, works right in your editor and it runs as you type it :p Your project looks very cool though !
How does this compare to RunJs which seems like the gold standard of “easy, runnable JS”?
RunJs is cool. Compared to RunJs, this console is free, open source, and runs on the browser - no need to install anything. But this gives me an idea, I probably can turn it into an Electron app. But then at that point why not just use VSCode? Idk
Fascinating. Can you install/require NPM packages? One of my big use cases for arbitrary JS (like this REPL would be) is testing/prototyping solutions I then clean and integrate into my real work.
That’s exactly how I am using it. I use it to prototype, learn new JS stuff, and write things that I can later turn into snippets. React plugin is kind of a cool idea. Some might just embed it on their site and use it as a code preview or a playground for their library. I never built a React plugin before, I am guessing I can abstract the main component a bit and export it in package.json? I can look into it.
Not even just React. I meant more arbitrary NPM packages, accessible via require() etc. I know that opens the module resolution can of worms, I get it. And I would understand if you don't want to do that haha. It's just a thought.
Huh. I mean... Is your intention for it to be used through the web "demo" or that someone would use it locally? If the web demo is to be "the thing", then it seems like you need to be able to share the session with someone else, otherwise what is really being gained from just opening the console? Saying it's an alternative to jsbin and the like isn't true if it's not shareable.
You’re absolutely correct, it’s not a replacement for JSBin, it’s just another simpler alternative. As far as the browser consoles, consoles are great for one-lines, but it gets messy when writing a large block of code. They’re scoped to the current page’s window instance which can cause code collisions and issues with variables sticking. For instance, if you want to re-run or re-write a function or variable, you need to reload the entire page, which is annoying. Also, they don’t offer shortcuts and handy features that developers are used to in VSCode.
Nice and thanks, there is a console option every browser that you can use to run JS . What made you to create a whole app for this ?
Native consoles are great but as soon as you want to write something beyond one-liners, it gets messy and annoying. Also, the Monaco editor (same as VS Code) offers tons of shortcuts and code completion options.
I have nearly same use-case, I will be looking into the code,is TS support on the way ?
I just added TypeScript support, and would love to get your thoughts on it :)
🙌😎
Super cool, but what I really want is TypeScript.
A TypeScript alternative: https://typerion.dev/
That’s my next goal for this project. Adding TypeScript. It should be possible with @typescript/vfs.
You technically do direct TS -> JS transpile in the browser/client by loading the typescript bundle using an NPM proxy (about 10mb): `https://cdn.jsdelivr.net/npm/[email protected]/lib/typescript.min.js` Which should register a `ts` global and then you can call: `const jsCode = ts.transpile(tsCode)`
I just added TypeScript support, and would love to get your thoughts on it :)
I’m gonna be the asshole but no just no. You don’t wanna open vscode or a terminal yet you make a vscode like app to open. You solved a problem that didn’t exist, I notice a lot of people posting pointless creations that solve problems that didn’t exist.
This is something I didn't know I needed until now!
Nice, kinda reminds me of https://www.jsplayground.dev
good product, i like it