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

ca-auth

v0.1.1

Published

Simple Secure Auth Lib

Readme

ca-auth

Simple Secure Auth Package

This Lib is the beginings of an Authentication framework. It makes use of crypto and sqlite3 to create, store, check hashed username / password combinations.

##Install npm install ca-auth

##API

ca-auth.init(Args, Args.hashkey, Args.path, Args.callback)

Inits authentication database

Parameters

Args: object, Only Real Param All Other Params should be properties of Args

Args.hashkey: string, can be any string, should be random data with a lenght atleast as long as any password being hashed. Must be the same Value between runs or hashes will not match

Args.path: string, [optional] path to sqlite3 database if not set _auth.db in package root will be created / used

Args.callback: function, [optional] called when DB is ready

 

ca-auth.close(callback)

Closes authentication database

Parameters

callback: function, [optional] called after db has ben closed

 

ca-auth.create(Args, Args.username, Args.userpass, Args.callback)

Creates User fails if user already exists

Parameters

Args: object, Only Real Param All Other Params should be properties of Args

Args.username: string, Username String could also be hash

Args.userpass: string, Password String could also be hash

Args.callback: function, [optional] will be passed error,authID error will be a string error string or null, authID will be a null or int users authID

 

ca-auth.authenticate(Args, Args.username, Args.userpass, Args.callback)

Authentication of users

Parameters

Args: object, Only Real Param All Other Params should be properties of Args

Args.username: string, Username String could also be hash (must be same as what was used for create)

Args.userpass: string, Password String could also be hash (must be same as what was used for create)

Args.callback: function, [optional] will be passed error,authID error will be a string error string or null, authID will be a null or int users authID

 

ca-auth.update(Args, Args.userid, Args.username, Args.userpass, Args.isEnabled, Args.callback)

Updates user data for a given userid fails if user does not exist

Parameters

Args: object, Only Real Param All Other Params should be properties of Args

Args.userid: int, authUID of the user to be updated

Args.username: string, [optional] Username String could also be hash

Args.userpass: string, [optional] Password String could also be hash

Args.isEnabled: int, [optional] can be 0 or 1

Args.callback: function, [optional] will be passed error,authID error will be a string error string or null, authID will be a null or int users authID

 

ca-auth.delete(Args, Args.userid, Args.callback)

Soft delete of user changes isEnabled to 0 preventing Authentication

Parameters

Args: object, Only Real Param All Other Params should be properties of Args

Args.userid: int, authUID of the user to be deleted

Args.callback: function, [optional] will be passed error,authID error will be a string error string or null, authID will be a null or int users authID

##TODO:

Coding:

Testing / Doc:

  • [x] Doc API

Eventualy:

  • [ ] Implement Public Key Authentication
  • [ ] Update Tests to check for changes on DB side after command
  • [ ] Implement Permissions system
  • [ ] Implement Logging system

####Disclaimer: This is a toy project, and should not be used for production grade anything ... use at your own risk