All Projects → grantcarthew → node-perj

grantcarthew / node-perj

Licence: other
A fast, flexible JSON logger.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-perj

Paris
Logger in Rust for pretty colors and text in the terminal. Aiming for a relatively simple API
Stars: ✭ 162 (+912.5%)
Mutual labels:  fast, simple, logger
Derrick
🙌 Derrick is a clean minimal and fast theme for a personal blog.
Stars: ✭ 51 (+218.75%)
Mutual labels:  fast, simple
Server Manager
This repository holds the IntISP Interface. It can be rebuilt to interface with any other hosting panel.
Stars: ✭ 31 (+93.75%)
Mutual labels:  fast, simple
Ataraxia
Simple and lightweight source-based multi-platform Linux distribution with musl libc.
Stars: ✭ 226 (+1312.5%)
Mutual labels:  fast, simple
Wyhash
The FASTEST QUALITY hash function, random number generators (PRNG) and hash map.
Stars: ✭ 410 (+2462.5%)
Mutual labels:  fast, simple
Try
Dead simple CLI tool to try Python packages - It's never been easier! 📦
Stars: ✭ 588 (+3575%)
Mutual labels:  fast, simple
Borm
【🔥今日热门】🏎️ 更好的ORM库 (Better ORM library that is simple, fast and self-mockable for Go)
Stars: ✭ 102 (+537.5%)
Mutual labels:  fast, simple
Begin Latex In Minutes
📜 Brief Intro to LaTeX for beginners that helps you use LaTeX with ease.
Stars: ✭ 3,082 (+19162.5%)
Mutual labels:  fast, simple
vertx-start
简单地、快速地启动vert.x的手脚架,保留了vert.x原汁原味的开发方式
Stars: ✭ 102 (+537.5%)
Mutual labels:  fast, simple
mocha-simple-html-reporter
Simple HTML reporter for Mocha
Stars: ✭ 16 (+0%)
Mutual labels:  fast, simple
logger
☠ 😈 👀 Simple,Secure & Undetected (6.11.2017) keylogger for Windows :)
Stars: ✭ 37 (+131.25%)
Mutual labels:  simple, logger
Onelog
Dead simple, super fast, zero allocation and modular logger for Golang
Stars: ✭ 389 (+2331.25%)
Mutual labels:  fast, logger
Maroto
A maroto way to create PDFs. Maroto is inspired in Bootstrap and uses gofpdf. Fast and simple.
Stars: ✭ 334 (+1987.5%)
Mutual labels:  fast, simple
Pino
🌲 super fast, all natural json logger
Stars: ✭ 8,475 (+52868.75%)
Mutual labels:  fast, logger
Wondercms
WonderCMS - fast and small flat file CMS (5 files)
Stars: ✭ 330 (+1962.5%)
Mutual labels:  fast, simple
base64.c
Base64 Library in C
Stars: ✭ 60 (+275%)
Mutual labels:  fast, simple
core
🌈 light, fast, and easy to use, dependencies free javascript syntax highlighter, with automatic language detection
Stars: ✭ 40 (+150%)
Mutual labels:  fast, simple
Kemal
Fast, Effective, Simple Web Framework
Stars: ✭ 3,227 (+20068.75%)
Mutual labels:  fast, simple
mini-async-log-c
Mini async log C port. Now with C++ wrappers.
Stars: ✭ 69 (+331.25%)
Mutual labels:  fast, logger
smk
SMK - Simple multimedia kit - C++ WebAssembly
Stars: ✭ 89 (+456.25%)
Mutual labels:  fast, simple

perj

A fast, flexible JSON logger.

Maintainability Test Coverage Build Status File Size NPM Version js-standard-style NSP Status Patreon Donation Twitter

perj

Installing

Node.js

The package.json has two configurations related to Node.js installations:

  • main: points to the minified version compiled for v6.0.0 and above.
  • module: points to the src files. Module field details.

The index.js points to the minified version compiled for v6.0.0 and above.

npm install --save perj

Browser

Use the dist files or bundle from src.

Type Size CDN
gzipped File Size https://unpkg.com/perj/dist/perj.min.js.gz
minified File Size https://unpkg.com/perj/dist/perj.min.js
full (source map) File Size https://unpkg.com/perj/dist/perj.js

See Unpkg for fixed version options.

Goals

  • Designed to be integrated (DIY) ✔️
  • Cross platform (Node.js and Browser) ✔️
  • Flexible log and additional property options ✔️
  • Fast ✔️

Features

  • No dependencies.
  • Flexible API (change almost everything).
  • Flexible log methods:
    • Log items can be any number in any order of any type.
  • The first string is nested under the 'msg' key:
    • First string includes a string argument or an Error message.
    • Additional string arguments are nested under the data key.
  • Objects are nested under the 'data' key as an object or array of objects.
  • Repeated string top level properties become hierarchical.
  • Examples to get you started.

Quick Start

Node.js Usage

The following example adds ver, name, host, pid and file top level property to the log output:

const Perj = require('perj')

// Customize the variables below as needed. They are not required.
const ver = 1
const name = 'QuickStart'
const host = require('os').hostname()
const pid = process.pid
const file = require('path').basename(module.filename, '.js')

const log = new Perj({ver, name, host, pid, file})

log.info('the quick brown fox jumps over the lazy dog')

/*

The following string is sent to standard out:

{"level":"info","lvl":30,"ver":1,"name":"QuickStart","host":"Dev","pid":233241,"file":"quick-start","time":1526102959677,"msg":"the quick brown fox jumps over the lazy dog","data":""}

*/

Browser Usage

The following example adds ver, name, and host top level property to the log entries:

const Perj = require('perj')

// Customize the variables below as needed. They are not required.
const ver = 1
const name = 'QuickStart'
const host = location.hostname

const log = new Perj({ver, name, host})

log.info('the quick brown fox jumps over the lazy dog')

/*

The following string is sent to the console:

{"level":"info","lvl":30,"ver":1,"name":"QuickStart","host":"http://Dev","time":1526103303019,"msg":"the quick brown fox jumps over the lazy dog","data":""}

*/

Documentation

For full documentation see the Wiki.

About the Owner

I, Grant Carthew, am a technologist, trainer, and Dad from Queensland, Australia. I work on code in a number of personal projects and when the need arises I build my own packages.

This project exists because I was not happy with other logging packages.

Everything I do in open source is done in my own time and as a contribution to the open source community.

If you are using my projects and would like to thank me or support me, please click the Patreon link below.

Patreon Donation

See my other projects on NPM.

Credit

This project only exists because it is standing on the shoulders of GIANTS.

Special thanks to the guys working on pino being:

A lot of the inspiration for perj came from the pino package.

Not to mention the other packages and resources used to help develop on the Node.js platform.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].