npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mybadprojects/easyconsolelog

v1.0.6

Published

Update 5 - console.log is now given up for process.stdout! | easyconsolelog adds features such as print(), warn() and error()!

Downloads

24

Readme

THIS IS ARCHIVED

easyconsolelog

This is designed to easily be used instead of stuff like console.log(). I created this because I am heavily adjusted to using print() rather than console.log so I don't get confused.

How to implement

To easily implement it do (for the non-logging):

const {print,warn,error} = require('easyconsolelog')

To use it (for the non-logging features) you can do:

const {print,warn,error,info} = require('easyconsolelog')

print('Print')
warn('Warn')
error('Error')
info('Info')

To use it with the basic logging features do: (as of 1.0.4)

const {setLevel,logLocation,autoSave,print,info,warn,error,saveLog,getLog,log,resetl,getSettings,loadSettings} = require('@mybadprojects/easyconsolelog')

resetl() // Resets logs
setLevel(1) // Changes logs level
logLocation('logs.log') // Changes where the logs are saved
log(true) // Enables logging
autoSave(true) // Enables auto-save
print('Print1') // Prints 'Print1' - LVL1
info('Print2') // Prints 'Print2' - LVL1
warn('Warn1') // Sends a warning saying 'Warn1' - LVL2
error('Error12') // Sends an error saying 'Error12' - LVL3
saveLog() // Saves logs manually
print(getLog()) // Prints logs
print(getSettings()) // Prints settings

To load settings in through a JSON string do:

loadSettings('{"onOff":true,"autoSave":true,"locationToSave":"logs.log","level":1,"levelWarnings":["","Warning: ","ERROR: "]}')

By the way

If you want to change the variables manually then you can access then as they are exported. The following are their names:

exports.logsOnOff
exports.logsAutosave
exports.logsLocationToSave
exports.logsLevel 
exports.logsLevelWarns
exports.logs

Plans for the next update:

Logs

This would mean there would be a function of log() and logLoaction() which would be used as

logsOnOff = true
logsLocationToSave = "logs.log"
log(logsOnOff) // This would only accept true & false
logLocation(logsLocationToSave) // This would only accept strings

This would allow logs to be toggles and a location for the logs to be saved to.

Information

Licence: GPL 3.0

How versions work:

Update 1.0.321 explained simply:

Edition = 1
Release = 0
Version = 3
UpdateOfVersion = 2
Patch = 1

This is basically (as a string):

version = `${Edition}.${Release}.${Version}${UpdateOfVersion}${Patch}`

It looks confusing but it is just best to stick with the newest one.