Socket
Book a DemoInstallSign in
Socket

comma-first

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comma-first

Format objects into a comma-first JSON string

0.0.1
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

comma-first

Build Status devDependency Status NPM version

Create a 2-space indented, comma-first JSON string of an object

Install

With npm

npm install comma-first

Usage

var commaFirst = require('comma-first')

var someObject = {
  array: [1, 2, 3, 4, 5]
, obj: {
    some: 'thing'
  , dark: 'side'
  }
, num: 20
}

console.log(commaFirst(someObject))
{
  "array": [
    1
  , 2
  , 3
  , 4
  , 5
  ]
, "obj": {
    "some": "thing"
  , "dark": "side"
  }
, "num": 20
}

File rewrite example

var commaFirst = require('comma-first')
  , fs = require('fs')
  , pkg = require('./package.json')

var out = commaFirst(pkg)

fs.writeFileSync(__dirname + '/package.json', out, 'utf8')

License

(The MIT License)

Keywords

json

FAQs

Package last updated on 22 Feb 2016

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.