Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

appendjson

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

appendjson

Append to or create a json file

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1K
decreased by-39.34%
Maintainers
1
Weekly downloads
 
Created
Source

Example

  • You need to append to a json file, but sometimes it hasn't been created yet.
  • This solves that problem.
var myJson = {
    name: {
        first: 'Jackson',
        last: 'Geller'
    }
}

// My file contains {dob: '9/27/1994'}
var myFile = 'data.json'

// Call -- creates file if it doesn't exist and appends
appendjson(myJson, myFile, function() {
    console.log('done')
})

/* output -- data.json
  {
    dob: '9/27/1994,
    name: {
        first: 'Jackson',
        last: 'Geller'
    }
  } 
*/


Installation

  • npm install appendjson --save

Use

var appendjson = require('appendjson');

appendjson(jsonObj, filepath, callback)

Keywords

FAQs

Package last updated on 07 May 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

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