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

jquery-typeof

v1.0.1

Published

A jQuery plugin to fix typeof inconsistencies in JavaScript. AMD (Require.js) and browser compatible.

Downloads

9

Readme

jQuery-typeof Build Status

A jQuery plugin to fix typeof inconsistencies in JavaScript. AMD (Require.js) and browser compatible.

To support this project, you can at the support page by supporting the developer.

Getting Started

NPM (What is NPM? What is Grunt?)

npm install jquery-typeof

Bower (What is Bower?)

bower install jquery-typeof

Download directly (Do not link this directly on your site, the file is sent with a plain/text header and can cause loading problems)

API & Usage

The jQuery-typeof plugin provides a fix to overcome JavaScript native typeof behaviour.

| Function | Description | Example | | -------- | ----------- | ------- | | $.typeof(value) | Returns the proper type of the passed value as a string. | $.typeof([]) === "array" |

In Browser (NPM)

    <!-- important to add jquery before jquery-typeof plugin -->
    <script src="node_modules/jquery-typeof/jquery.typeof.js"></script>

In Browser (Bower)

    <!-- important to add jquery before jquery-typeof plugin -->
    <script src="bower_components/jquery-typeof/jquery.typeof.js"></script>

In Browser (Require.js)

    <script>
        require(["jquery", "jquery-typeof"], function($) {
                /* jquery-typeof is usable from now on */
        });
    </script>

In case, you have some strange problems using jQuery with Require.js, try the following:

  • install Require.js using npm (npm install requirejs)
  • install jQuery using npm (npm install jquery)
  • install jquery-typeof using npm (npm install jquery-typeof)

After these steps, using Require.js .config(...) function, additional setup is needed to use jQuery:

require.config({
    baseUrl: "./",
    paths: {
        jquery: "node_modules/jquery/dist/jquery"
    }
});

And the final, usable example:

    <script>
        require.config({
            baseUrl: "./",
            paths: {
                jquery: "node_modules/jquery/dist/jquery"
            }
        });
        require(["jquery", "node_modules/jquery-typeof/jquery.typeof"], function($) {
                /* jquery-typeof is usable from now on */
        });
    </script>

In case you would like to use paths to make the code more clear and readable, this is recommended:

    <script>
        require.config({
            baseUrl: "./",
            paths: {
                jquery: "node_modules/jquery/dist/jquery",
                "jquery-typeof": "node_modules/jquery-typeof/jquery.typeof"
            }
        });
        require(["jquery", "jquery-typeof"], function($) {
                /* jquery-typeof is usable from now on */
        });
    </script>

In Browser (Directly downloaded source)

    <!-- important to add jquery before jquery-typeof plugin -->
    <script src="scripts/jquery.typeof.js"></script>

In the code:

    /* This list below provides the usability of this plugin */

    $.typeof() === "undefined"
    $.typeof(undefined) === "undefined"
    $.typeof(null) === "null"
    $.typeof(true) === "boolean"
    $.typeof(false) === "boolean"
    $.typeof(-1) === "number"
    $.typeof(0) === "number"
    $.typeof(1) === "number"
    $.typeof(-Infinity) === "number"
    $.typeof(Infinity) === "number"
    $.typeof(NaN) === "number"
    $.typeof("string") === "string"
    $.typeof([]) === "array"
    $.typeof({}) === "object"
    $.typeof(function(){}) === "function"
    $.typeof(new Date()) === "object"
    $.typeof(/s+/g) === "object"
    $.typeof(new Error()) === "object"

Internet Explorer 8 and Below

This plugins is compatible with IE8 and was tested with IE8 & jQuery 1.9.0.

Suggestions, Ideas & Requests

Post any occurring suggestions, useful ideas and requests to the project's issue page under the suggestion/idea/request label by clicking here.

  • Constructive criticism is encouraged and welcomed by contacting the developer or using GitHub.

Issues/Bugs

In case of any occurring issues and/or bugs, post on the project's issues page with appropriate label(s).

Support

If you find this tool useful, you can support this project by supporting the developer here.

Contribution & A Note

In the spirit of open source software development, this project is always open to and encourages community code contribution. To get started, just run through the source file, check the comments and general coding style and start to contribute.

  • In case you find this tool useful, support it by supporting the developer, follow the developer on social platforms or send an email to the developer.

License

Copyright (c) 2014 "Richard KnG" Richárd Szakács. Licensed under the MIT license.

The license mentioned above applies to all parts of this software except as documented below

All files located in the node_modules and external directories are externally maintained libraries used by this software which have their own licenses. We recommend you read them, as their terms may differ from the terms above.