Thanks so much!

It's working perfectly. In my frantic googling I also found this:

https://gist.github.com/brentsimmons/7819109

but it requires node. Yours is way more elegant.

On Tuesday, 7 April 2020 09:49:39 UTC+10, Charlie Garrison wrote:
>
> On 7 Apr 2020, at 8:59, jh wrote:
>
> I realise it would only work if the document is saved to disk of course. 
> js-beautify has the option to read from STDIN as well, so can I do that, 
> and have the output piped back in to the current document?
>
> Yep, do it with STDIN/STDOUT. Here is a text filter I've got installed:
>
> #!/bin/sh
>
> ## https://github.com/einars/js-beautify
> ## https://www.npmjs.org/package/js-beautify
>
> # js-beautify -f - --good-stuff
> /usr/local/bin/js-beautify --e4x   -f -
>
> Using STDIN/STDOUT means you also process the *selected* text, rather 
> than processing the whole file.
>
> -cng
>
> -- 
>
> Charlie Garrison                   <[email protected] <javascript:>>
> Garrison Computer Services      <http://www.garrison.com.au>
> PO Box 380
> Tumbarumba NSW 2653  Australia
>
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/5440069d-bd0e-4b94-82b3-e06213640d84%40googlegroups.com.

Reply via email to