3 ms·
Show HN: TxtFiddle – JavaScript playground for text manipulation tasks
- jackmac92 6y agowhy not just use jsfiddle?
- awulf 6y agoThe 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).
- high_byte 6y agoso this is basically eval('var input = inputElement.innerText;' + jsElement.innerText)
- awulf 6y agoBasically, 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.
- st0le 6y agonice. very similar to CyberChef[1] except it allows custom JS code. 1. https://gchq.github.io/CyberChef/ https://gchq.github.io/CyberChef/
- nitramm 6y agoI 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?
- awulf 6y agoThank you for the input. I have now added a separate "Templates" menu item.