npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details


  • User packages



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.


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




To incorporate Layer Authentication with Parse user management in your application, you will need to use Parse Cloud Code along with this module. This module takes care of generating a Layer Identity Token, and only requires you to implement a few lines o




Parse Cloud Code Module For Layer

To incorporate Layer Authentication with Parse user management in your application, you will need to use Parse Cloud Code along with this module. This module takes care of generating a Layer Identity Token, and only requires you to implement a few lines of code.

##Installation If you haven't already, install the Parse command line tool that will let you manage the Parse Cloud Code for your application by following the directions outlined here.

To get the Layer Module, clone this repo, and place it in your Parse Cloud Code Directory in the 'cloud' folder:

    git clone


###Creating your Cloud Function To use this module in your Parse Cloud Code, you have to require the module and initialize it with the proper IDs and keys.

Step 1: Start by navigating to the 'keys' folder in the repo you just cloned, and open the layer-key.js file. Copy the Private Key generated through the Keys section of the Dashboard into this file and save it. The contents of layer-key.js should look like:


Step 2: To require this module, open your main.js file and include this code at the top:

var fs = require('fs');
var layer = require('cloud/layer-parse-module/layer-module.js');

Step 3: Next you must initialize the instance of this module with the proper Provider ID (>Keys->Provider ID) and Key ID (>Keys->Authentication Keys) generated in your Layer Developer Portal. Define them in the main.js file:

var layerProviderID = 'YOUR-PROVIDER ID-HERE';  // Should have the format of layer:///providers/<GUID>
var layerKeyID = 'YOUR-KEY ID-HERE';   // Should have the format of layer:///keys/<GUID>
var privateKey = fs.readFileSync('cloud/layer-parse-module/keys/layer-key.js').toString();
layer.initialize(layerProviderID, layerKeyID, privateKey);

Step 4: Finally, you must create Parse Cloud function to call the generateToken function in the module. The Cloud function will look something like this in main.js:

Parse.Cloud.define("generateToken", function(request, response) {
    var currentUser = request.user;
    if (!currentUser) throw new Error('You need to be logged in!');
    var userID =;
    var nonce = request.params.nonce;
    if (!nonce) throw new Error('Missing nonce parameter');
        response.success(layer.layerIdentityToken(userID, nonce));

Step 5: Make sure you actually upload your Parse Cloud code by executing the following command in the terminal:

$ parse deploy

The file structure should look like this when you're done:

├── layer-parse-module
│   ├── keys
│   │   └── layer-key.js
│   ├── layer-module.js
│   └── node_modules
│       └── jsrsasign
│           ├── Makefile
│           ├──
│           ├── _t2.js
│           ├── lib
│           │   ├── footer.js
│           │   ├── footer.js~
│           │   ├── header.js
│           │   └── jsrsasign.js
│           └── package.json
└── main.js

###Calling your Cloud Function Once you have created the Cloud function with the layer-parse-module, you must call this function from your application and pass it the appropriate parameters (the userID and a nonce). The userID you are looking for is the objectID of the Parse User. Wherever you are requesting a nonce for authentication, your code should look like this:


    // Request an authentication nonce from Layer
    [layerClient requestAuthenticationNonceWithCompletion:^(NSString *nonce, NSError *error) {
        NSLog(@"Authentication nonce %@", nonce);
        // Upon reciept of nonce, post to your backend and acquire a Layer identityToken  
        if (nonce) {
	        PFUser *user = [PFUser currentUser];
	        NSString *userID  = user.objectId;
	        [PFCloud callFunctionInBackground:@"generateToken"
	                           withParameters:@{@"nonce" : nonce,
	                                            @"userID" : userID}
	                                    block:^(NSString *token, NSError *error) {
	            if (!error) {
	            	// Send the Identity Token to Layer to authenticate the user
	                [self.layerClient authenticateWithIdentityToken:token completion:^(NSString *authenticatedUserID, NSError *error) {
	                    if (!error) {
	                        NSLog(@"Parse User authenticated with Layer Identity Token");
	                        NSLog(@"Parse User failed to authenticate with token with error: %@", error);
	                NSLog(@"Parse Cloud function failed to be called to generate token with error: %@", error);


	layerClient.registerAuthenticationListener(new LayerAuthenticationListener() {
        public void onAuthenticationChallenge(final LayerClient client, String nonce) {
            Log.d(TAG, "The nonce: " + nonce);

            ParseUser user = ParseUser.getCurrentUser();
            String userID = user.getObjectId();

            // Make a request to your backend to acquire a Layer identityToken
            HashMap<String, Object> params = new HashMap<String, Object>();
            params.put("userID", userID);
            params.put("nonce", nonce);
            ParseCloud.callFunctionInBackground("generateToken", params, new FunctionCallback<String>() {
                void done(String token, ParseException e) {
                    if (e == null) {
                    } else {
                        Log.d(TAG, "Parse Cloud function failed to be called to generate token with error: " + e.getMessage());

        public void onAuthenticated(LayerClient client, String userId) {
            Log.d("Successful Auth with userId: " + userId);

        public void onDeauthenticated(LayerClient client) {
            Log.d("Successful Deauth.");

        public void onAuthenticationError(LayerClient client, int errorCode, String errorMessage) {
            Log.d("Error: " + errorMessage);

You are now ready to build you app using Layer!

Troubleshooting Tips

  1. Make sure that the layer-key.js only includes the private key and no other text.
  2. Make sure you're setting the layerProviderID, layerKeyID, privateKey in the main.js not the layer-module.js.
  3. Double check all the values in step #2. All values can be found under Keys in the dashboard.
  4. Use the identity token validator under Tools in the Dashboard. It should help identify what the issue is.