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 🙏

© 2026 – Pkg Stats / Ryan Hefner

receptive

v1.1.2

Published

This is a package developed to save work, time, resources on unit tests.

Readme

receptive

This is a package developed to save work, time, resources on unit tests.

const receptive = require('receptive')

let error = null;
let trust = null;//any value, object, element, etc. that you want to return if the error condition is not met.

receptive.paddingOne = 0;//any value, object, element, etc. that you want to return if the error condition is met. The default value is only set once unless you want to change it.

receptive.value(error, trust, receptive.paddingOne);//return 0.

trust = true;

receptive.value(error, trust, receptive.paddingOne);//return true.

Functions

value(value, equivalent, res)

valueOrElse(value, equivalent, res, otherwise)

operator(value, "operator", equivalent)

  • receives three parameters the value to compare the operator and the equivalent of the value, if the condition is met it returns the equivalent.

operatorPlus(value, "operator", equivalent, return)

  • the same as the operator() function but in this case it returns the fourth parameter, if the condition is met.

More ways to take advantage of its functionality

String

const receptive = require('receptive')

let left  = "false";
let right = "false";

receptive.paddingOne = "Not available";

receptive.value(left, right, receptive.paddingOne);//return "Not available".

left  = "false";
right = "true";

receptive.value(left, right, receptive.paddingOne);//return "true".

left  = "true";
right = "true";

receptive.value(left, right, right);//return "true".

Number

const receptive = require('receptive');

let left  = 0;
let right = 0;

receptive.paddingOne = 0;

receptive.value(left, right, receptive.paddingOne);//return 0.

left  = 0;
right = 1;

receptive.value(left, right, receptive.paddingOne);//return 1.

left  = 1;
right = 1;

receptive.value(left, right, right);//return 1.

Boolean

const receptive = require('receptive');

let left  = false;
let right = false;

receptive.paddingOne = false;

receptive.value(left, right, receptive.paddingOne);//return false.

left  = false;
right = true;

receptive.value(left, right, receptive.paddingOne);//return true.

left  = true;
right = true;

receptive.value(left, right, right);//return true.

Array

const receptive = require('receptive');

let left  = ["string", { res: "Not available" }, false  ];
let right = ["string", { res: "Available"     }, true   ];

receptive.paddingOne = left[1].res;

receptive.value(left[0], right[0], receptive.paddingOne);//return "Not available".

receptive.value(left[0], right[1].res, receptive.paddingOne);//return "Available".

receptive.value(left[0], right[0], right[2]);//return true.

Object

const receptive = require('receptive');

let left  = { 
    res:  "Not available", 
    more: "Available"
}; 

let right = { 
    res:  "Available",
    more: "Not available"
};

receptive.paddingOne = left.res;

receptive.value(left.more, right.res, receptive.paddingOne);//return "Not available".

receptive.value(left.res, right.res, receptive.paddingOne);//return "Available".

receptive.value(left.more, right.res, right.res);//return "Available".

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 0.10 or higher is required.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

$ npm install receptive

License

ISC