New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

json

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

3

bin/json.js
#!/usr/bin/env node
var sys = require("sys"),
jsonCommand = require("../lib/jsonCommand");
var jsonCommand = require("../lib/jsonCommand");

@@ -6,0 +5,0 @@ var args = process.argv.slice(0);

@@ -1,2 +0,2 @@

var sys = require("sys"),
var util = require("util"),
vm = require("vm");

@@ -33,34 +33,34 @@

JSON.Command.prototype.printhelp = function() {
sys.puts("usage: stdout_generator | json [options] [fields]");
sys.puts("");
sys.puts("json processes standard input and parses json objects. json currently handles a");
sys.puts("few different standard input formats and provides a number of options tailored");
sys.puts("toward inspecting and transforming the parsed json objects.");
sys.puts("");
sys.puts("options:\n");
sys.puts(" -h print this help info and exit\n");
sys.puts(" -v (-V | --version) print version number and exit\n");
sys.puts(" -u print ugly json output, each object on a single line\n");
sys.puts(" -d print debugging output including exception messages\n");
sys.puts(" -o object.path specify the path to an array to be iterated on\n");
sys.puts(" new.key=old_key move old_key to new.key in output object\n");
sys.puts(" -a input object is an array, process each element separately\n");
sys.puts(" -c \"js conditional\" js conditional to be run in the context of each object");
sys.puts(" that determines whether an object is printed\n");
sys.puts(" -C print the output fields as tab delimited columns in");
sys.puts(" the order specified by fields\n");
sys.puts(" -e \"js expression\" execute arbitrary js in the context of each object.\n");
sys.puts(" -i use node's sys.inspect instead of JSON.stringify\n");
sys.puts(" -H print headers, if they are supplied.");
sys.puts(" Useful for output from curl -i.\n");
console.log("usage: stdout_generator | json [options] [fields]");
console.log("");
console.log("json processes standard input and parses json objects. json currently handles a");
console.log("few different standard input formats and provides a number of options tailored");
console.log("toward inspecting and transforming the parsed json objects.");
console.log("");
console.log("options:\n");
console.log(" -h print this help info and exit\n");
console.log(" -v (-V | --version) print version number and exit\n");
console.log(" -u print ugly json output, each object on a single line\n");
console.log(" -d print debugging output including exception messages\n");
console.log(" -o object.path specify the path to an array to be iterated on\n");
console.log(" new.key=old_key move old_key to new.key in output object\n");
console.log(" -a input object is an array, process each element separately\n");
console.log(" -c \"js conditional\" js conditional to be run in the context of each object");
console.log(" that determines whether an object is printed\n");
console.log(" -C print the output fields as tab delimited columns in");
console.log(" the order specified by fields\n");
console.log(" -e \"js expression\" execute arbitrary js in the context of each object.\n");
console.log(" -i use node's util.inspect instead of JSON.stringify\n");
console.log(" -H print headers, if they are supplied.");
console.log(" Useful for output from curl -i.\n");
sys.puts("examples:\n");
sys.puts(" curl http://search.twitter.com/search.json?q=node.js 2> /dev/null |");
sys.puts(" json -o results\n");
sys.puts(" curl http://search.twitter.com/search.json?q=node.js 2> /dev/null |");
sys.puts(" json -o results new_id=id\n");
sys.puts(" curl http://search.twitter.com/search.json?q=node.js 2> /dev/null |");
sys.puts(" json -o results -C from_user from_user_id text\n");
sys.puts("more help:\n");
sys.puts(" use \"man json\" or visit http://github.com/zpoley/json-command\n");
console.log("examples:\n");
console.log(" curl http://search.twitter.com/search.json?q=node.js 2> /dev/null |");
console.log(" json -o results\n");
console.log(" curl http://search.twitter.com/search.json?q=node.js 2> /dev/null |");
console.log(" json -o results new_id=id\n");
console.log(" curl http://search.twitter.com/search.json?q=node.js 2> /dev/null |");
console.log(" json -o results -C from_user from_user_id text\n");
console.log("more help:\n");
console.log(" use \"man json\" or visit http://github.com/zpoley/json-command\n");
process.exit();

@@ -72,3 +72,3 @@ };

npm.load([], function(er) {
sys.print("json command line toolkit\n version: ");
console.log("json command line toolkit\n version: ");
npm.commands.view([ "json", "version" ], function(er, data) {

@@ -82,3 +82,3 @@ process.exit();

JSON.Command.prototype.stringify = function(obj) {
return( this.inspectOutput ? sys.inspect(obj, false, Infinity, true)
return( this.inspectOutput ? util.inspect(obj, false, Infinity, true)
: this.uglyOutput ? JSON.stringify(obj)

@@ -89,3 +89,3 @@ : JSON.stringify(obj, null, 2) );

JSON.Command.prototype.debug = function(msg) {
if (this.debugOn) { sys.puts(msg); }
if (this.debugOn) { console.log(msg); }
};

@@ -151,3 +151,3 @@

break;
case "-i": // use sys.inspect
case "-i": // use util.inspect
this.inspectOutput = true;

@@ -154,0 +154,0 @@ break;

{ "name": "json"
, "version": "0.0.9"
, "version": "0.0.10"
, "engines": [ "node >=0.4.0" ]
, "description": "JSON command line processing toolkit."
, "author": "Zachary Poley <zpoley@gmail.com> (http://zpoley.net)"
, "contributors": [ "Isaac Schlueter <i@izs.me> (http://blog.izs.me)", "Andrey Tarantsov <andreyvit@gmail.com> (http://www.tarantsov.com/)" ]
, "contributors": [ "Isaac Schlueter <i@izs.me> (http://blog.izs.me)", "Andrey Tarantsov <andreyvit@gmail.com> (http://www.tarantsov.com/)", "Niek Schmoller <niek.schmoller@helderberg.nl> (http://helderberg.nl)" ]
, "keywords" : [ "json", "command", "shell" ]

@@ -8,0 +8,0 @@ , "man" : "./man/json.1"

@@ -33,15 +33,15 @@ # JSON Command

curl http://search.twitter.com/search.json?q=node.js 2> /dev/null | json
curl -s http://search.twitter.com/search.json?q=node.js | json
curl http://search.twitter.com/search.json?q=node.js 2> /dev/null | json -o results
curl -s http://search.twitter.com/search.json?q=node.js | json -o results
curl http://search.twitter.com/search.json?q=node.js 2> /dev/null | json -o results from_user metadata
curl -s http://search.twitter.com/search.json?q=node.js | json -o results from_user metadata
curl http://search.twitter.com/search.json?q=node.js 2> /dev/null | json -o results new_id=id
curl -s http://search.twitter.com/search.json?q=node.js | json -o results new_id=id
curl http://search.twitter.com/search.json?q=node.js 2> /dev/null | json -o results -C from_user from_user_id
curl -s http://search.twitter.com/search.json?q=node.js | json -o results -C from_user from_user_id
curl http://stream.twitter.com/1/statuses/sample.json -uAnyTwitterUser:Password 2> /dev/null | json user.name user.id
curl -s http://stream.twitter.com/1/statuses/sample.json -uAnyTwitterUser:Password | json user.name user.id
curl http://stream.twitter.com/1/statuses/sample.json -uAnyTwitterUser:Password 2> /dev/null | json user.name user.id -c "entities.user_mentions.length > 0"
curl -s http://stream.twitter.com/1/statuses/sample.json -uAnyTwitterUser:Password | json user.name user.id -c "entities.user_mentions.length > 0"

@@ -48,0 +48,0 @@ ## Synopsis

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc