npm.io
1.1.0 • Published 7 years ago

@fastpointopensource/fp-utils

Licence
ISC
Version
1.1.0
Deps
2
Size
7 kB
Vulns
0
Weekly
0

fp-utils package description

this package is intended to add utility lib to fastpoint nodejs developments. This lib contains the following methods:

Installation

$ npm install @fastpointopensource/fp-utils

Use

const utils = require('@fastpointopensource/fp-utils')

Methods

.lwp(label, text)

console logging method to display a label padded (30) with dots and some text.

label....................... text
.logtitle(label, displayFullTitle)

console logging method to display a label with some formatting.

When displayFullTitle = false

+++++++++++++++++++++++++++++++++++++++++++++ title ++++++++++++++++++++++++++++++++++++++++++++++++

When displayFullTitle = true

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++ title ++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.hexdump(label, buf, displayOffset, displayValue)

hexdump in the console a buffer with a label. Starting offset can be set. Value in ascii can be enabled. hexdump("hexdump",Buffer.from("c78dde55e55bae27,"hex",0,true))

hexdump....................... c78d de55 e55b ae27    ...U.[.'
.randomValueHex(len)

generates a hex number of len bytes returned as a string (not a buffer!)

.logger

log4js logger available. log file

utils.configureLog(logFilename)
utils.logger.info('test')