26.1.0 • Published 6 years ago

five-bells-shared v26.1.0

Weekly downloads
8
License
Apache-2.0
Repository
github
Last release
6 years ago

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();

  // ...
});
26.1.0

6 years ago

26.0.0

6 years ago

25.1.1

7 years ago

25.1.0

7 years ago

25.0.0

7 years ago

24.0.0

7 years ago

23.0.0

7 years ago

22.0.1

7 years ago

22.0.0

7 years ago

21.2.0

7 years ago

21.1.1

7 years ago

21.1.0

7 years ago

21.0.2

7 years ago

21.0.1

7 years ago

21.0.0

7 years ago

20.0.0

7 years ago

19.1.1

8 years ago

19.1.0

8 years ago

19.0.0

8 years ago

18.4.0

8 years ago

18.3.0

8 years ago

18.2.0

8 years ago

18.1.0

8 years ago

18.0.0

8 years ago

17.0.0

8 years ago

16.1.0

8 years ago

16.0.0

8 years ago

15.0.0

8 years ago

14.1.2

8 years ago

14.1.1

8 years ago

14.1.0

8 years ago

14.0.0

8 years ago

13.0.3

8 years ago

13.0.2

8 years ago

13.0.1

8 years ago

13.0.0

8 years ago

12.4.0

8 years ago

12.3.0

8 years ago

12.2.4

8 years ago

12.2.3

8 years ago

12.2.2

8 years ago

12.2.1

8 years ago

12.2.0

8 years ago

12.1.2

8 years ago

12.1.1

8 years ago

12.1.0

8 years ago

12.0.0

8 years ago

11.2.2

8 years ago

11.2.1

8 years ago

11.2.0

8 years ago

11.1.1

8 years ago

11.1.0

8 years ago

11.0.0

8 years ago

10.1.0

8 years ago

10.0.0

8 years ago

9.3.0

8 years ago

9.2.1

8 years ago

9.2.0

8 years ago

9.1.2

8 years ago

9.1.1

8 years ago

9.1.0

8 years ago

9.0.1

8 years ago

9.0.0

8 years ago

8.10.1

8 years ago

8.10.0

8 years ago

8.9.0

8 years ago

8.8.0

8 years ago

8.7.0

8 years ago

8.6.0

8 years ago

8.5.0

8 years ago

8.4.0

8 years ago

8.3.0

8 years ago

8.2.0

8 years ago

8.1.0

8 years ago

8.0.1

9 years ago

8.0.0

9 years ago