emuto

Emuto 是一种小型语言,用于操作和重组 JSON 和其他数据文件。「Emuto is a small language for manipulating and restructuring JSON and other data files.」

Github星跟踪图


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

Contributing Guide

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.

主要指标

概览
名称与所有者kantord/emuto
主编程语言JavaScript
编程语言JavaScript (语言数: 4)
平台
许可证MIT License
所有者活动
创建于2018-08-31 10:46:00
推送于2025-03-10 23:46:44
最后一次提交2024-12-19 18:15:04
发布数58
最新版本名称v1.43.0 (发布于 )
第一版名称v1.0.0 (发布于 )
用户参与
星数223
关注者数4
派生数7
提交数518
已启用问题?
问题数98
打开的问题数41
拉请求数371
打开的拉请求数8
关闭的拉请求数375
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?