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

user-management-service

v0.0.9

Published

[![CircleCI](https://circleci.com/gh/gettyio/user-management-service.svg?style=svg&circle-token=6a57d09534c679006020998aff84e1df6bc89cb5)](https://circleci.com/gh/gettyio/user-management-service)

Downloads

6

Readme

User management service

CircleCI

This package provides some utilities for user management from the express route down to the mongoose data layer.

How to use

It's quite simple, just do:

import users from 'user-management-service';

const unless = {
  path: [
    { url: /\/signup/ },
    { url: /\/login/ }
  ]
};

mongoose.Promise = Promise;

const app = express();
app.use(bodyParser.json());
app.use(users({ secret: 'somesecret', app, unless, mongoose }));

The options required are:

  • secret: some string secret used to encode and decode the tokens
  • app: the express app
  • mongoose: the mongoose object used on your project
  • unless: the endpoints you don't want to be authenticated

In case you want the login and signup to be in different sub-endpoints:

const unless = {
  path: [
    { url: /\/your\/endpoint\/signup/ },
    { url: /\/your\/endpoint\/login/ }
  ]
};

app.use('/your/endpoint', users({ ..., unless }));

Implementation details

This package saves the users in an users collection on mongodb, requiring the fields username, password and email and accepting a role field.

We don't implement anything related to ACLs, so you can use your own implementation or use some third party library.

TODO

  • Implement Facebook login
  • Implement Google login
  • Recover password