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

project-json-combiner

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

project-json-combiner

Combines project.json in smartface workspace environment

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

project-json-combiner

Combines project.json in smartface workspace environment In a provided path scans the directory for name matching project.json OR project..json files and combines them.

Install

npm i --save project-json-combiner

Usage

Require the module first

var projectJSONCombiner = require("project-json-combiner");

Rules

  • fs object must be passed
  • Scans folder non-recursivly
  • File names are case sensitive "project**.<anySingleWord>**.json"
  • It has built in caching mechanisim

Get combined project.json

var fs = require("fs");
projectJSONCombiner.getProjectJSON("./", fs, function(err, projectJSON){
  // handle error if any
  console.log(projectJSON.info.name);
}) ;

Error handling

In case of malformatted json files, JSON parser will throw errors. That first encountered error will trigger the callback with that information. The error object passed also contains currentFile property stating which file is faulty.

Caching

Caching is enabled by default.

projectJSONCombiner.cache.enabled = false;  //or true

Object is cached for duration of 1 second by default Caching is enabled by default.

projectJSONCombiner.cache.duration = 5000;  //in miliseconds

Keywords

FAQs

Package last updated on 21 Jul 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