Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Maintainers
1
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

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

  • 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