Catalog npm
Back to packageRELEASE DETAILS

0.0.2

npm

2json

json flattener that outputs lines similar to xml2

json2xml2
Published1 Dec 2016
Direct dependencies2
Transitive dependenciesNot calculated

README

Current package documentation

json2

simple utility for transforming json documents into grep-able and sed-able lines

install

# json2 was already taken
npm install -g 2json

usage

# json2 args
json2 [file] [< or_file]

# 2json
# -p flag pretty prints json
2json [file] [< or_file] [-p --pretty]

# get package name
basename $(json2 package.json | grep '/name')

# change package name and reconvert lines to json using 2json
json2 < package.json | sed 's@\(/name\)/.*@\1/new-name@' | 2json -p

escapes for json2/2json

The following are escaped--by being in quote strings, as per rules:

  • all forward slashes (/)
  • all index brackets ([ or ])
  • all strings that are just number characters (e.g. 00193425)

You must escape double quotes in strings, json2 does this.

backslash escapes for 2json

The following characters must be escaped to handle issues with newlines using backslashes, whether in quotes or not:

\ <- escape as \\
\n
\r
\f

notes

/ [ ] are reserved by the json line grammar, if such values are found in your json, they will be quoted in double quotes.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 2

Native requirements
2 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
lodash
Environment
{
  "local_name": "lodash",
  "alias": false,
  "peer_metadata": null
}
^4.17.2runtime
pegjs
Environment
{
  "local_name": "pegjs",
  "alias": false,
  "peer_metadata": null
}
^0.10.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "e2334ff57e5e585dbe4bf4107c80cb40147763c4",
  "tarball": "https://registry.npmjs.org/2json/-/2json-0.0.2.tgz",
  "integrity": "sha512-tB9BL4tDv7gukG903LkLSFNm+uxF17hGQtgsjc+C+6IAgzfzA4KI/0xZFBQYDFhINCj9ezb3enNkHEpUJFsFtg==",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIDzB91bKfJ/7d9pz6NuodDhDKCttzk02ENYW0zBFq5koAiB8/0Ia/DA6UlCEuYvF4RNmYlj5CQelcbOcK02ihh7yCw=="
    }
  ]
}

Repository

PENDING
generalunrest/json2

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:14 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:99d274f7e455fd5a86fe3a6d70dd6cb78fa87487e36701550fab7158a4341baa

Other collected versions

0.2.12 Dec0.2.0-readme12 Dec0.2.02 Dec0.1.01 Dec0.0.11 DecView all collected versions →