fx-jsydeprecated

Combine the excelent `fx` utility with JSY syntax

Usage no npm install needed!

<script type="module">
  import fxJsy from 'https://cdn.skypack.dev/fx-jsy';
</script>

README

fx-jsy: fx with JSY syntax dialect

Combining the excellent fx utility from Anton Medvedev with JSY syntax dialect.

Documentation

See the fx documentationall the hard work was done by Anton Medvedev anyway!

Use

$ npm install -g fx-jsy
$ echo '[3, 4, 5]' | npx fx-jsy '.map @ x => x ** x'

[
  27,
  256,
  3125
]
$ fx-jsy .dependencies .fx < package.json
^3.0.3

A more complex example converting JSON to CSV:

$ curl https://jsonplaceholder.typicode.com/posts | fx-jsy \
    '[ Object.keys(this[0]) ].concat @ this.map @ ea => Object.values(ea)' \
    '.map @ ea => ea.map @ val => JSON.stringify(val)' \
    '.map @ ea => ea.join @ `,`' \
    '.join @ `\n`' \
    > test.csv

License

MIT