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

elementary-auth

v1.0.2

Published

A simple system for authentication in web apps for Node.js

Readme

elementary-auth

A simple auth library for the authentication of users in web apps or APIs

Developed By MrShoe_

Install

To install elementary-auth use this command:

npm install elementary-auth

Usage

To use the library you first need to initalise the authentication object

const authenticationManager = require('elementary-auth')

const authManager = new authenticationManager(
    encryption_key,
    salt
)

The encryption_key is used to encrypt and protect your users password for you so you dont need to encrypt the data yourself

and the salt is used to help protect the password so that any hacker cant brute force any passwords and help keep them protected

createUser

Here is how you can create a user

authManager.createUser(
    username,
    password,
    other
)

The username and password are obvious, but the other item is used to store data for or about the user. For example, you can store things like settings or user role

Return Value:

    return {
        username: usernname,
        password: encrypted_password,
        data, other
    }

checkUser

See if a username is valid

authManager.checkUser(
    username,
    password,
    other
)

Return Value:

    return
        true
            ||
        false

getUser

Gets the user object bassed on username

authManager.getUser(username)

Return Value:

    return {
        username: usernname,
        password: encrypted_password,
        data, other
    }

verifyUser

This simply checks the users password and verifys if they entered the correct password

authManager.verifyUser(username, password)

this simply returns a true/false value

deleteUser

Deletes a user bassed on the username

authManager.deleteUser(username)

changePassword

Simply changes the users password bassed on the username

authManager.changePassword(username, newPassword)

Tokens

Tokens are normaly used for authentication in web apps and can be stored in the cookies or as JWT on the client or browser

createToken

Create token generates a 50000 long string uniqe to there user sesson

authManager.createToken(username)

and this returns the token for the user

checkToken

Check and verify the token for a user

authManager.checkToken(token)

Return Value:

    return  
        [true, username] // If token is valid
            ||
        [false, undefined] // if token is invalid

deleteToken

Simply removes a token from being usable

authManager.deleteToken(token)

importData / exportData

This simply imports and exports the auth data with the .importData() and .exportData() functions to be stored in a database or other location

Data storage

if you would like to store your data, we would recomend using a package we also developed, elementary-db a simple database for storing json data