Skip to content

kantord/emuto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4a3066a · Dec 19, 2024
Dec 19, 2024
Oct 1, 2019
Aug 31, 2018
Oct 1, 2019
Mar 25, 2019
Oct 7, 2018
Oct 26, 2018
Oct 26, 2018
Oct 18, 2018
Oct 26, 2018
Dec 29, 2018
Oct 12, 2018
Feb 22, 2019
Oct 26, 2018
Oct 26, 2018
Aug 31, 2018
Mar 29, 2019
Sep 28, 2018
Oct 26, 2018
Oct 26, 2018
Aug 9, 2018
Dec 18, 2024
Mar 11, 2019
Oct 7, 2018
Oct 1, 2019

Repository files navigation

WebsiteTutorialLive demoCLI versionCompile-to-JS version


Emuto is a small language for manipulating and restructuring JSON and other data files. Emuto is inspired by jq and GraphQL

build Codecov David NPM GitHub release Twitter URL

Features

  • Transform and query data structures
  • Integrate with unix commands in the command line
  • Conversions between different file formats
  • Supported input formats: JSON, text, csv, tsv, dsv
  • Supported output formats: JSON, text
  • Available as a Webpack loader

Getting started

Emuto as a CLI tool

npm install -g emuto emuto-cli

Read more in the tutorial

For Arch Linux users, also available as an AUR package

Webpack loader for emuto

yarn add --dev emuto emuto-loader

Read more in the Webpack guide

What is emuto good for? Examples

Number of items in JSON file

curl my_file.json | emuto 'length'

Your karma on HackerNews

curl https://hacker-news.firebaseio.com/v0/user/kantord.json -s | emuto '$.karma'

Convert another command's output to JSON

ls | emuto -i=raw '$[0:-1]'

See number of NPM dependencies

cat package.json | emuto -c '$.dependencies | keys | length'

List available scripts in package.json

cat package.json | emuto -c '$.scripts | keys | join " · "'

Get only the relevant data from a huge JSON file

curl https://api.github.com/repos/stedolan/jq/commits |\
emuto -c 'map ($ => $ { commit { message } committer { login } } )'

Automate the restructuring of data by creating scripts with emuto

restructure.emu

#! emuto -s

$
  | map ($ => $ { commit { message } committer { login } } )
  | map ($ => {
      "committer": $.committer.login,
      "message":   $.commit.message,
    })

Calling your script

curl https://api.github.com/repos/stedolan/jq/commits | ./restructure.emu

Read our contributing guide to learn about our development process, how to create bugfixes and improvements, and how to build and test your changes to emuto.

Packages

No packages published

Contributors 4

Languages