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

logging-timely

v1.1.0

Published

an npm to log every error and save it to file

Downloads

7

Readme

#Installation Using npm :

npm install logging-timely

#How to Use ##log of one file let logging = require('logging-timely'); //object creation let log = new logging(); //set filename and directory for log log.fileName = 'error'; log.directory = './log/'; //set time of logging log.logOnce(); //initial logging log.createLog(); //write log log.write('i am log'); // time of log inserted will also be written ##log of per minute log.filename = 'error'; log.logMinutely(); log.createLog(); setInterval() log.Minutely('i am log');

#Attribute ##fileName you can create file name, but the filename will get prefix of time you use as log ###set log.fileName = 'error'; ###get log.fileName if you use minutely as logging then the filename would be DD_MM_YYYY-hh_mm_filename.log ##directory ###set log.directory = './logHour/'; don't forget to use ./ before and / after directory name ###get log.directory

#Method used ##timely ###logOnce() set time of log to only one time logging file ###logMinutely() set time of log to create one logging file per minute ###logDaily() set time of log to create one logging file daily ###logHourly

Open and Ending Log

###createLog() create file to stream ###endLog() closing file stream

##Write Messages ###write() write message to file (to only a file) ###Monthly write message to file Monthly(change file log monthly) ###Hourly() write message to file hourly (change file log Hourly) ###Minutely() write message to file minutely (change file log minutely) ###Daily() write message to file daily (change file log daily)

#Example program let logging = require('./npm-logging'); let path = require('path'); let log = new logging(); log.directory = './logMinute/'; log.fileName = path.basename(__filename); log.logMinutely(); let logHourly = new logging(); logHourly.directory = './logHour/'; logHourly.logHourly(); let logDaily = new logging(); logDaily.directory = './logDay/'; logDaily.logDaily(); let logMonthly = new logging(); logMonthly.directory = './logMonth/' logMonthly.logMonthly();

//open stream log

log.createLog();
logHourly.createLog();
logDaily.createLog();
logMonthly.createLog();
//function
setInterval(writeMessages,10000);

function writeMessages(){
	log.Minutely('i am in minutely log');
	logDaily.Daily('i am in daily log');
	logHourly.Hourly('i am in hourly log');
	logMonthly.Monthly('i am in monthly log');
}