unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Which package is your goto package for pretty-printing javascript?
@ 2019-02-25  7:00 Alex Vong
  2019-02-26  7:34 ` Vladimir Sedach
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alex Vong @ 2019-02-25  7:00 UTC (permalink / raw)
  To: help-guix; +Cc: alexvong1995

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

Hello,

For uglifying javascript, of course we can use 'uglify-js' in
(gnu packages lisp). How about pretty-printing? Are there some good
utilities you use for doing it?

Cheers,
Alex

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Which package is your goto package for pretty-printing javascript?
  2019-02-25  7:00 Which package is your goto package for pretty-printing javascript? Alex Vong
@ 2019-02-26  7:34 ` Vladimir Sedach
       [not found] ` <5c74ec11.1c69fb81.2956f.ea6eSMTPIN_ADDED_BROKEN@mx.google.com>
  2019-02-26 18:24 ` Christopher Baines
  2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Sedach @ 2019-02-26  7:34 UTC (permalink / raw)
  To: Alex Vong; +Cc: help-guix

I use json-reformat.el in Emacs, and the jq program (which does
pretty-printing, among many other things) when I have to shell
script.

Vladimir

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Which package is your goto package for pretty-printing javascript?
       [not found] ` <5c74ec11.1c69fb81.2956f.ea6eSMTPIN_ADDED_BROKEN@mx.google.com>
@ 2019-02-26 18:06   ` Alex Vong
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Vong @ 2019-02-26 18:06 UTC (permalink / raw)
  To: Vladimir Sedach; +Cc: guile-user, help-guix, alexvong1995

[-- Attachment #1: Type: text/plain, Size: 1203 bytes --]

[I'm CC'ing guile-user because what I'm about to say might be more
relevant there...]

Vladimir Sedach <vas@oneofus.la> writes:

> I use json-reformat.el in Emacs, and the jq program (which does
> pretty-printing, among many other things) when I have to shell
> script.
>
Isn't both programs work with json instead of javascript? Anyway, after
thinking more careful, it seems I need something more powerful than a
pretty-printer. I'll ask in guix-devel about this later.

However, thanks for letting me know about jq! In the homepage, it is
mentioned that "jq is like sed for JSON data". This sounds very
interesting: *nix filters typically work with string line by
line. Data-structure-wise, we are working with list. More precisely,
it's stream (aka lazy list) because we may not get the whole thing
during piping and redirection.

On the other hand, in lisp, we work with s-expression (tree). I've been
wondering if it's possible to create *nix filters that work with
tree. It seems it's exactly what jq is doing!

One application I've long dreamt about: create a variant of grep which
works with context free grammar instead of regular expression. I've even
decided to name it cfgrep...

> Vladimir

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Which package is your goto package for pretty-printing javascript?
  2019-02-25  7:00 Which package is your goto package for pretty-printing javascript? Alex Vong
  2019-02-26  7:34 ` Vladimir Sedach
       [not found] ` <5c74ec11.1c69fb81.2956f.ea6eSMTPIN_ADDED_BROKEN@mx.google.com>
@ 2019-02-26 18:24 ` Christopher Baines
  2 siblings, 0 replies; 4+ messages in thread
From: Christopher Baines @ 2019-02-26 18:24 UTC (permalink / raw)
  To: Alex Vong; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 301 bytes --]


Alex Vong <alexvong1995@gmail.com> writes:

> For uglifying javascript, of course we can use 'uglify-js' in
> (gnu packages lisp). How about pretty-printing? Are there some good
> utilities you use for doing it?

If you're looking to do this in a shell, jq (in the jq package) is a
good tool to use.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-26 18:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-25  7:00 Which package is your goto package for pretty-printing javascript? Alex Vong
2019-02-26  7:34 ` Vladimir Sedach
     [not found] ` <5c74ec11.1c69fb81.2956f.ea6eSMTPIN_ADDED_BROKEN@mx.google.com>
2019-02-26 18:06   ` Alex Vong
2019-02-26 18:24 ` Christopher Baines

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).