Giter Club home page Giter Club logo

catj's Introduction

catj's People

Contributors

johnjohndoe avatar soheilpro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

catj's Issues

Key's with hyphen's rendered improperly.

I agree this format is easier to read. Nice work!

I noticed what I think is a problem though. Using this example event from AWS, I am noticing that keys with hyphen are being rendered like arrays in square brackets. I don't pretend to be an expert on the JSON spec but I don't think that is right.

{
  "version": "0",
  "id": "CWE-event-id",
  "detail-type": "CodePipeline Action Execution State Change",
  "source": "aws.codepipeline",
  "account": "123456789012",
  "time": "2017-04-22T03:31:47Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:codepipeline:us-east-1:123456789012:pipeline:myPipeline"
  ],
  "detail": {
    "pipeline": "myPipeline",
    "version": 1,
    "execution-id": "01234567-0123-0123-0123-012345678901",
    "stage": "Prod",
    "action": "myAction",
    "state": "STARTED",
    "region":"us-west-2",
    "type": {
      "owner": "AWS",
      "category": "Deploy",
      "provider": "CodeDeploy",
      "version": 1
    }
  }
}
.version = "0"
.id = "CWE-event-id"
.["detail-type"] = "CodePipeline Action Execution State Change"
.source = "aws.codepipeline"
.account = "123456789012"
.time = "2017-04-22T03:31:47Z"
.region = "us-east-1"
.resources[0] = "arn:aws:codepipeline:us-east-1:123456789012:pipeline:myPipeline"
.detail.pipeline = "myPipeline"
.detail.version = 1
.detail["execution-id"] = "01234567-0123-0123-0123-012345678901"
.detail.stage = "Prod"
.detail.action = "myAction"
.detail.state = "STARTED"
.detail.region = "us-west-2"
.detail.type.owner = "AWS"
.detail.type.category = "Deploy"
.detail.type.provider = "CodeDeploy"
.detail.type.version = 1

jq script equivalent

copy pasted from : https://news.ycombinator.com/item?id=20246727

  #!/usr/bin/jq -jf
  jq -j '
    [
      [
        paths(scalars)
        | map(
          if type == "number"
          then "[" + tostring + "]"
          else "." + .
          end
        ) | join("")
      ],
      [
        .. | select(scalars) | @json
      ]
    ]
    | transpose
    | map(join(" = ") + "\n")
    | join("") 
  '

(just so that if somebody come accross your great project, and wants to do something equivalent without needing npm )

require 'catj' maybe ?

Thanks for catj !

Will it be possible to use it a node module sometime in the future ?

Cheers !

Feature request: reverse operation

Allow generation of json file from the .dot.brackets[0]: colon syntax.

Reasoning:
It would be then possible to use this as a basis for a plugin to config editors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.