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

sparc-commons

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sparc-commons

Library with all small time common stuff used across the SPARC echosystem

0.2.19
Version published
Weekly downloads
3
200%
Maintainers
1
Weekly downloads
 
Created

COMMON PACKAGE

This is the common package for all SPARC servers and products. Right now it contains the following things:

  • logger - based on log4js
  • resources - based on needle
  • utils - all the rest of the crap, including a function to load handlebar templates

The library expects to find a configuration file in the config/ folder of the root project. Following is an example of such configuration file

{
    "version": "0.2.4",
    "logging": {
        "appenders": [
            {
                "type": "console",
                "layout": {
                    "type": "pattern",
                    "pattern": "[%d %p %c] %m"
                }
            }
        ],
        "levels": {
            "[all]": "DEBUG"
        },
        "replaceConsole": "true"
    },

    //TODO: hook this up in a http making library
    "resource": {
        "test_resource": {
            "method": "get",
            "url": "http://bogus.com",
            "uri": {
                "boguservice": "bellobell",
                "boguservice2": "gallogall"
            },
            "api-params": {
                "apikey": "asdfg"
            }
        }
    }
}

For the logger configuration please refer to log4js documentation. Resources is pretty straightforward

FAQs

Package last updated on 10 Mar 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