User management module for Nxus apps.


0202.3.135 years ago6 years agoMinified + gzip package size for @nxus/users in KB



Build Status

User management module for Nxus apps. Users provides a complete framework for managing users, authenticating routes and sessions.


> npm install @nxus/users --save


Once Users is installed in your app, you are ready to go. It includes the following components:

  • user/team models
  • login/logout routes
  • authentication/session middleware


Uses defines a set of common models you can use to build your application, using the @nxus/storage module (which uses Waterline to provide common ORM functionality).


Accessing the user model:

app.get('storage').getModel('user').then((User) => {


  • email: string
  • password: string
  • nameFirst: string
  • nameLast: string
  • position: string
  • enabled: boolean
  • admin: boolean
  • lastLogin: datetime
  • metadata: JSON
  • team: relation to Team model

Convenience Methods

  • name(): first + last name
  • isAdmin(): boolean if user is an Admin
  • validPassword(pass): returns true if the password is valid


Users defines a set of common templates you can use in your app


A login form preconfigured to work with the login/logout routes. Markup supports basic Bootstrap 3 CSS.

app.get('templater').render('users-login').then((content) => {


The Users module defines some convience routes for handling basic user functionality.


Params Expects to recieve a POSTed form with the values username, password and redirect. redirect should be a url to redirect the user to on success. On login failure, the user will be redirected back to /login.


Params Expects to recieve a GET request with the param redirect, which is a url where the user will be redirected on successful logout.



The Users Module provides a complete user authentication and authorization system.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.