1.0.10 • Published 6 years ago

jsonawk-cli v1.0.10

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

jsonawk

  • awk style json line processor(use js code)
  • support awk style: $ BEGIN END
  • support loadash: _

installation

npm install -g jsonawk-cli

usage

file.json

{"userid":"001","name":"torvalds"}
{"userid":"002","name":"tj"}
cat file.json | jsonawk 'console.log($.name)'
torvalds
tj

use lodash

cat file.json | jsonawk 'console.log(_.join([$.name, "making the world better"], " "))'
torvalds making the world better
tj making the world better

use BEGIN,END

cat file.json | jsonawk 'BEGIN{var n=0;}{n++;console.log(_.join([$.name, "making the world better"], " "))  }END{console.log(n)}' 
torvalds making the world better
tj making the world better
2

todo

  • contact al@xfruit.cn
1.0.10

6 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago