1.1.0 • Published 5 years ago

@fastpointopensource/fp-utils v1.1.0

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

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')
1.1.0

5 years ago

1.0.0

5 years ago