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

jquery-facebook-authorize

v1.0.0

Published

jQuery Plugin to simplify the process of requesting Facebook permissions, such that you only proceed forward in sign-up once the user has granted all you require.

Readme

jquery-facebook-authorize

jQuery Plugin to simplify the process of requesting Facebook permissions, such that you only proceed forward in sign-up once the user has granted all you require.

This worked with v2.5 and v2.6, I haven't back-tested it, and let me know if it breaks in the future.

Install

Simply include the asset and the Facebook API, see under Usage below.

Usage

This is simpler, but does require that you initial the Facebook API in your page already, something like the following:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="jquery-facebook-authorize/jquery.facebook-authorize.min.js"></script>

<script>
window.fbAsyncInit = function() {
    FB.init({
        appId   : XXXXXXXXXXXXXXXXXXXXXXX,
        cookie  : true,
        xfbml   : true, /* parse social plugins on this page. */
        version : 'v2.5'
    });
};

(function(d, s, id){
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) {return;}
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>


<div id='error_msgs'></div>

<div class='row'>
  <button id='facebook_request' class="btn btn-default" style="color:#0b62a4;">
    <i class="fa fa-facebook-square"></i> Login with Facebook
  </button>
</div>

<script>
    $(function() {
        var $fbreq = $('#facebook_request');

        var options = {required : ['public_profile', 'email', 'user_friends', 'publish_actions'],
                       optional: []};
        $fbreq.facebookAuthorize(options);

        $fbreq.on('facebook-request-clicked', function(event) {
            $('#error_msgs').empty();
        });
        $fbreq.on('facebook-missing-required', function(event, missing) {
            $('#error_msgs').text('missing: ' + JSON.stringify(missing));
        });
        $fbreq.on('facebook-success', function(event, granted, missing, details) {
            /* move the user onto whatever step applies. */
            createOrLogin(granted, details);
        });
        $fbreq.on('facebook-not-authorized', function(event) {
            $('#error_msgs').text('not authorized');
        });
        $fbreq.on('facebook-not-loggedin', function(event) {
            $('#error_msgs').text('not logged in...');
        });
    });
</script>

Options

| Option | Description | | ---- | ---- | ---- | | required | List of required permissions. | | optional | List of optional permissions. |

Events

| Event | Handler | | ---- | ---- | | facebook-request-clicked | function(event): - event - jQuery event | | facebook-missing-required | function(event, missing): - event - jQuery event - missing - comma separated string of missing required permissions | | facebook-success | function(event, granted, missing, details): - event - jQuery event - granted - comma separated string of all permissions granted - missing - comma separated list of any missing optional permissions - details - Facebook API response.authResponse object | | facebook-not-authorized | function(event): - event - jQuery event | | facebook-not-loggedin | function(event): - event - jQuery event |

License

Apache License 2.0