1.0.2 • Published 2 years ago

javascript-func v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

javascript-func

This package contains a Javascript utilities functions to help developers to start with a standard base to their developments.

Table of Contents


Installation


npm install javascript-func

Features


In this package you will find the following features:

Logger

Log

General features to log your code in terminal and daily files, based on bunyan package. The output log format is: yyyy-mm-dd date LABEL: hostname/pid on server: DATA

  • info(data): log with a INFO label
  • warn(data): log with a WARN label
  • error(data): log with a ERROR label
  • debug(data): log with a DEBUG label
  • fatal(data): log with a FATAL label

Encryptation

Crypto

Encryption features that allows you to keep exposed information secure Functions:

  • encrypt(data, key, output): encrypt the data with the given key, the output value indicates if the function encrypt or not
  • decrypt(data, key, output): decrypt the data with the given key, the output value indicates if the function decrypt or not
  • send(data, key, output): encrypt the data with the given key to be sent as api response, the output boolean value indicates if the result is showed or not
  • receive(data, key, output): decrypt the data with the given key to be receive as api request, the output boolean value indicates if the result is showed or not
  • encryptObject(object, key): encrypt the object with the given key
  • encryptObject(object, key): decrypt the object with the given key

Date

DateFormat

Fomat date or date string to the following string formats DDMMYYYY, YYYYMMDD and HHMM

  • format(date, format): Convert to date string in one of the following valid formats: DDMMYYYY, YYYYMMDD or HHMM

Release notes


1.0.X

Initial version with the following features:

  • Log
  • Crypto
  • DateFormat