New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

cleanjson

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cleanjson

Format JSON document from stdin as 'comma-first' JSON

latest
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

Installation

$ npm install -g cleanjson

CLI Usage

  • Publish your "dirty" JSON at some URL using services such as http://hastebin.com, http://gist.github.com or http://cl.ly

  • Acquire a URL that points to "raw" JSON, such as: http://goo.gl/7IiVZ

  • Run a command such as:

    $ curl -Ls http://goo.gl/7IiVZ | cleanjson
    
  • Enjoy

Using as a Module

var cj = require('cleanjson');

var input = '{"a": 13123, "b": "13123", "ccc": 112}';

cj.clean(input, function(err, cleanJSON) {
  
  console.log(cleanJSON);
  process.exit(0);  
  
});

will produce following output:

{
  "a": 13123
, "b": "13123"
, "ccc": 112
}

Keywords

json

FAQs

Package last updated on 01 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts