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

character

v0.3.0

Published

Identify agents in the world, and track their memories

Downloads

61

Readme

Character

Authentication, SSO, user management, and overall identity solution for Node.js

Build Status

Character is a turnkey solution that makes it faster, easier, and cheaper to add a complete user system for your applications:

  • authentication
  • SSO
  • system administration
  • user management
  • and more ...

You don't have to use all the features. Character is modular, so you can use only the features you need.

Getting started

Installing

Install Character from npm:

$ npm install character

You also need to install the peer dependencies.

Usage

Character exports an Express Router which can be mounted onto any Express 4.x app with app.use. This is a clean mount which does not interfere with existing routes, because almost all middleware is mounted under /auth (configurable).

It reads its configuration from character.yml by default (configurable).

Here is example usage from the Local authenticator example:

// Load Character core and plugins
const character = require('character')()
const authentication = require('character/authentication')

character.use(authentication);

// Attach as Express middleware
app.use(character.create())

// Protect any route with `req.isAuthenticated`
app.get('/restricted', (req, res) => {
  if (req.isAuthenticated()) {
    res.send('Hello world')
  } else {
    res.redirect('/login')
  }
})

Note how authentication was added as a plugin. The modular nature of Character makes it easy to build a custom identity solution.

Documentation

Why Character?

Presently there are two main options for building Node.js applications:

  • build and support a custom solution with a low-level library, e.g. Passport
  • use a commercial service, e.g. Auth0

Character combines the key benefits of both options. Install it on your own server and keep control of your own data!

| Benefit | Custom solution | Character | Commercial service | | ------------------------------------------------------------------ | --------------- | --------- | ------------------ | | Save R&D time and money with a pre-built solution | | ✅ | ✅ | | Secure your applications with best-practices and security updates | | ✅ | ✅ | | Protect against known vulnerabilities | | ✅ | ✅ | | Use a security-audited and penetration-tested solution | | (planned) | ❔ | | On-premise: comply with your enterprise security requirements | ✅ | ✅ | ❔ | | Open source: verify the code that handles your user data | ✅ | ✅ | | | Keep your user data our of third-party hands | ✅ | ✅ | | | Avoid costly service fees (e.g. for registered but inactive users) | ✅ | ✅ | | | Avoid complicated licensing fee structures | ✅ | ✅ | |

Features / Roadmap

Target for initial release

  • [ ] Authentication
    • [x] Local: username / password
    • [ ] Support for third-party authenticators (similar to Passport strategies)
  • [ ] Configuration panel
  • [ ] Registration
  • [ ] User administration panel

Beyond initial release

  • Authentication
    • Passwordless / magic links
    • LDAP
    • OAuth
    • Social logins
    • Two-factor / multi-factor
    • ... and other authenticators (similar to Passport strategies)
  • Auditing
  • Role-based access control (RBAC)
  • Account linking (e.g. link a Facebook and LinkedIn login to the same account/identity)
  • Password resets and invalidation
  • Single sign-on
  • User on-boarding experience
  • Account locking / anomaly detection
  • Honeypots
  • Password hash upgrading

Contributing

This project welcomes contributions from the community. Contributions are accepted using GitHub pull requests; for more information, see GitHub documentation - Creating a pull request.

For a good pull request, we ask you provide the following:

  1. Include a clear description of your pull request in the description with the basic "what" and "why"s for the request.
  2. The tests should pass as best as you can. GitHub will automatically run the tests as well, to act as a safety net.
  3. The pull request should include tests for the change. A new feature should have tests for the new feature and bug fixes should include a test that fails without the corresponding code change and passes after they are applied.
  4. If the pull request is a new feature, please include appropriate documentation in the Readme.md file as well.
  5. To help ensure that your code is similar in style to the existing code, run the command npm run lint and fix any displayed issues.

Bug reports and security disclosures

Create a GitHub issue to report a bug. Please provide sufficient details to reproduce the bug, such as version numbers, error logs, and example code if possible.

If you have discovered a security related bug, please do NOT use the GitHub issue tracker. Send an email to [email protected].

People

The lead author is Faraz Syed.

List of all contributors

Support

Create a GitHub issue to ask a question. Make sure to add [question] to the beginning of your issue's title.

Commercial support is also available:

  • Consulting (install, config, maintain, upgrade, migrate)
  • Sponsored feature development
  • Training
  • Future: Hosted Character / SaaS

Commercial support contact: [email protected]

License

MIT