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

jsx-react-utils

v1.0.11

Published

JS and React utils

Readme

jsx-react-utils

JSX/React Utils is a library that overhauls a lot of things in JS and React.

Installation

Install library from NPM using following command:

npm install jsx-react-utils --save

Usage

Important note!

You should not import anything that requires this library in definition (e.g. classes extending ReactComponent), since jsx-react-utils does not define anything until you call its initializer function. This may lead to ReferenceError: ReactComponent is not defined, which means that you're trying to use jsx-react-utils before it has been initialized.

The easiest way so solve this is to place jsx-react-utils imports and initialization into a separate file and include it before your component imports. See example below:

jsx-react-utils.jsx:

import jsxReactUtils from "jsx-react-utils";

jsxReactUtils(['common', 'frontend'], {
	dependencies: {/* dependencies (see below) */}
});

your-entry-point.jsx:

import "./jsx-react-utils";

import "./Components/MyComponent";
import "./Components/MyOtherComponent";

// Your app initialization and ReactDOM.render()
// ...

Dependencies

You have to provide default exports from the dependent packages. You should import them manually in any way you want, e.g. separate vendor.min.js file, direct imports like in example below or from your favorite CDN via <script> tags.

jsx-react-utils.jsx:

import React from "react";
import Bluebird from "bluebird";
import jQuery from "jquery";
import querystring from "querystring";
import fileSaver from "file-saver";

import jsxReactUtils from "jsx-react-utils";

jsxReactUtils(['common', 'frontend'], {
	dependencies: {
		"react":       React,
		"bluebird":    Bluebird,
		"jquery":      jQuery,
		"querystring": querystring,
		"file-saver":  fileSaver,
	}
});

You can pass null or an empty/non-empty object if you don't plan on using corresponding features.

Features which require particular packages are described below:

  • react – Essential dependency for frontend module. You can omit this dependency if you use common module only.
  • bluebird – Essential for any async functionality both in common and frontend modules. If omitted, vanilla Promise will be used.
  • jquery – Required only for URL.fetch and URL.fetchRaw functions.
  • querystring – Required only for URL.build and URL.parseQuery functions.
  • file-saver – Required only for FileModel.download method. You may pass your own function of the same signature.

Modules

common

This module can be used both in backend and frontend environment.

frontend

This module is supposed to be used in frontend environment, but you can use it on backend as well (e.g. in universal/isomorphic application), just make sure to pass React dependency.

Configuration

There are few configuration options available at the moment:

  • cssNamespace{String} ReactComponent's CSS classes prefix
  • dependencies{Object} Dependencies, key is the package name, value is it's default export
  • log{Object} Allows you to configure some components' log level

Documentation

Sadly, no documentation yet :c