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

evil-js

v1.0.1

Published

Sometimes using a full blown debugger is too much, or not possible, thats when its time to get EVIL!

Downloads

14

Readme

EvilJS - The Runtime Debugger for Lazy Developers

Sometimes using a full blown debugger is too much, or not possible, thats when its time to get EVIL!

npm version dependencies Build Status lifetimeDownloadCount

#Hows it work?

Evil does exactly what it sounds like, it does something EVIL, it adds a prototype function to Javascripts core Types
Evil Supports!
Object.prototype.evil
Number.prototype.evil
Boolean.prototype.evil
Array.prototype.evil
String.prototype.evil

#Install

npm install evil-js --save

#Usage

require('evil-js'); 
//
// write some code
//
let fred = { x : 0 };
//
// do some stuff, and need to debug fred, because your lost as hell
// continue writing your code like usual! except use .evil() to access its value
//
if(fred.evil()){
    // do stuff
}

Output :

[DEBUG]	:	{"x":0}

#Advanced Usage

Evil.log = console.log;

Lets you modify the logger, by default its set to console.log, but you can set it to any method that takes in a String

Evil.pad = (typeof process !== 'undefined'?process.env.EVIL_PAD:false);

pre/post pad evil logs, defaults to false so it doesnt pad, but if you set to ' ' (truthy) it will for instance add an extra line before and after the logs

Evil.stack = (typeof process !== 'undefined'?process.env.EVIL_STACK:false);

outputs the stack trace of the evil caller, (removes evils internal part of the stack)

Evil.pretty = (typeof process !== 'undefined'?process.env.EVIL_PRETTY:false);

When evil outputs values it uses JSON.stringify(value, null, 0), pretty makes the 0 a 3

Evil.bypass = (typeof process !== 'undefined'?process.env.NODE_ENV==='production':false);

stops evil from being completely evil, still adds evil function but removes all functionality

Feel free to override these values at any point either by changing the env vars or by assigning Evil[property]

#True Evil

Evil is chainable?! well of course! it actually has to be

var variable = { key : '7' };

if(variable.evil('obj').key.evil('value')){

}

#Output

[obj]	:	if(variable.evil('obj').key.evil('value')){	 : 	{"key":"7"}
[value]	:	if(variable.evil('obj').key.evil('value')){	 : 	"7"

Labeling Evil

Evil allows you to label calls
obj.evil('my label')

if you have Evil.filter set to an array it will only log ones whos label are contained in said array

Evil.filter = ['safey'];

obj.evil('yolo')

obj.evil('safey')

Only safety will be debugged