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

uams

v1.0.0

Published

UAMS - user access management system

Downloads

1

Readme

UAMS

Build Status

User Access Management System

User account management middleware for Restify.

See Restify Starter for example usage.

Features

  • Plugs into existing Restify servers
  • Configurable options for route endpoints, JWT tokens, etc.
  • Extensible Mongoose models

Roadmap

  • Forgotten password recovery
  • Publish NPM module

Motivation

Although a decent number of Node frameworks can manage users, most fall short on integration. Aqua (previously Drywall) came the closest, though it provides no way to extend the user model to include your own fields.

UAMS aims to simply and extensibly:

  • Provide all of the basic features for user management
  • Be quick & easy for rapid MVP development
  • Allow more control over routes and models
  • Be minimally invasive to your existing code
  • Work almost completely out of the box with almost no configuration

Installation

$ npm i

Setup / Configuration

A basic example Restify server using UAMS:

// app.js
'use strict'
const restify = require('restify')

const app = restify.createServer({
    name:    'UAMS/Restify Example',
    version: '1.0.0'
})

app.use(restify.plugins.acceptParser(app.acceptable))
app.use(restify.plugins.fullResponse())
app.use(restify.plugins.queryParser())
app.use(restify.plugins.bodyParser({ extended: true }))
app.use(restify.plugins.gzipResponse())
app.use(restify.plugins.authorizationParser())

const uams = require('../../uams')({
    app,                            // Restify server instance
    log: console,                   // Any compatible logger (see readme)
    mongoose: require('mongoose'),  // Mongoose instance
    userField: 'email',             // User field (typically "email" or "username")
    passField: 'password',          // Password field
    jwtTokenSecret: 'abc123',       // JWT token secret
    jwtExpiresIn: '24hr',           // JWT token expiration
    excludeDbFields: [              // Fields to be excluded from responses
        '__v',
        'password',
        'lastActiveAt'
    ]
})

app.use(uams.middleware)

module.exports = app
// index.js
'use strict'

const app = require('./app')

require('require-all')(path.resolve(__dirname, 'routes'))

const host = process.env.HOST || '0.0.0.0'
const port = process.env.PORT || 8080

app.listen( port, host, console.info(
    `App listening at http://${host}:${port}` ) )

Options

| Option | Default Value | Required | Description | | --------------- | ---------------- | -------- | ----------- | | app | null | Yes | Restify server instance | mongoose | null | Yes | Mongoose instance | log | console | No | Any compatible logger (see readme) | userField | username | No | User field (typically "email" or "username") | passField | password | No | Password field | jwtTokenSecret | null | No | JWT token secret | jwtExpiresIn | null | No | JWT token expiration | excludeDbFields | [''] | No | Fields to be excluded from responses | routes | - | No | - | routes.signup | /users | No | POST signup route | routes.login | /users/login | No | POST login route | routes.update | /users | No | PUT update route | routes.fetch | /users | No | GET fetch route | userSchema | {} | No | Additional fields to add to the user model (see Mongoose Schema)


Donate

Buy me a scotch to say thanks & fund future development!

Bitcoin: 1MxHTKiBPTusqNaBrxcbkDyYL68tvndZ3N

Ethereum: 0x68Df32F670E025cf3870d9021Ec6B5b4af1425DC