Live data from Hacker News

Show HN: TxtFiddle – JavaScript playground for text manipulation tasks

txtfiddle.com

1–8 of 8 posts

Re: Show HN: TxtFiddle – JavaScript playground for text manipulation tasks

#3

why not just use jsfiddle?

The main reason is ease of use. Of course, you can use JSFiddle to create an HTML page with a textarea field and a button that triggers your code and outputs the result to the console or somewhere else. But that's a lot of overhead for a simple text editing task.

TxtFiddle is specifically built for text manipulation tasks and reduces the amount of code you have to write to a minimum. There's also a (growing) list of templates that you can choose from (see the "New" menu). Another differentiating feature is the ability to abort a running script (i.e., in the case of an accidental infinite loop).

Re: Show HN: TxtFiddle – JavaScript playground for text manipulation tasks

#5

so this is basically eval('var input = inputElement.innerText;' + jsElement.innerText)

Basically, yes. In practice, there's a bit more to it. The user code is wrapped into an "async function(input)" (so you can use async/await) and run inside a worker inside a sandboxed iframe (for security reasons and for being able to stop the execution). There's also some additional code for catching errors and parsing the error stack.

Re: Show HN: TxtFiddle – JavaScript playground for text manipulation tasks

#7
I have been just clicking on the "New" menu. It was not clear to me that I should mouse over and wait. There are many interesting transformations such as "Generate SQL INSERT INTO statement from CSV" or "Generate ASCII table from CSV/TSV". They could be more prominent. How about moving them from "New" into "Library" section?

Re: Show HN: TxtFiddle – JavaScript playground for text manipulation tasks

#8
post #7

I have been just clicking on the "New" menu. It was not clear to me that I should mouse over and wait. There are many interesting transformations such as "Generate SQL INSERT INTO statement from CSV" or "Generate ASCII table from CSV/TSV". They could be more prominent. How about moving them from "New" into "Library" section?

Thank you for the input. I have now added a separate "Templates" menu item.