Socket
Book a DemoInstallSign in
Socket

five-bells-shared

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

five-bells-shared

Shared components for Five Bells projects.

26.1.0
latest
Source
npmnpm
Version published
Weekly downloads
367
37.97%
Maintainers
1
Weekly downloads
 
Created
Source

Five Bells Shared npm circle codecov

Shared module among Five Bells Node.js apps

Installation

npm install --save five-bells-shared

Schema Validator

This module contains a schema validator.

Log Service

The log service uses mag and a custom formatter to generate pretty logs like this:

Example log output

Usage

Set up the logger somewhere in your top-level app:

const hub = require('mag-hub')
const mag = require('mag')
const log = require('five-bells-shared/lib/log')

module.exports = log(mag, hub)

Then use it from anywhere using require('mag'):

const log = require('mag')('transfers')

log.debug('very boring information')
log.info('somewhat useful information')
log.warn('sort of important information')
log.error('super-important information')

Caveat

If you're using mag in a module which is npm linked, it will receive its own instance of mag and messages will not be formatted correctly. To solve this problem, you can install the mag module globally and link it in all of your local modules:

sudo npm install -g mag
npm link mag # in each module directory

Log Test Helper

The log helper is useful in tests to mute the log output of tests and print it if the test fails.

Usage

const logHelper = require('five-bells-shared/testHelpers/log');

describe('Transfers', function () {
  logHelper();

  // ...
});

Keywords

interledger

FAQs

Package last updated on 22 Nov 2017

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.