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

arbojs

v0.0.27

Published

Lightweight CMF

Downloads

7

Readme

ArboJS

A short documentation on using ArboJS.

Introduction

ArboJS

Modules

ArboJS is built of modules

Base

This module defines some base methods to be shared by every other module implemented:

  • .setup(conn)
  • .uninstall(conn)
  • .ensurePermission(conn, userId, sectionId, permissionsIds)
  • .searchDeep(conn, userId, offset, limit)
  • .checkCRUDPermission(req, res, next, target)

Additionally, ArboJS can also create REST endpoints automatically for every module implemented, creating POST, GET, PUT and DELETE routes.

Example: a module named User will have the routes:

  • POST: /User/
  • GET: /User/:id
  • PUT: /User/
  • DELETE: /User/:id

Crypto Utils

Contains some helper functions using Node's crypto package:

  • hash(salt, msg, enc = 'base64')

    Hashes a msg using the given salt and returns the resulting hash encoded using the optional parameter enc (if not sent, will default to base64 encoding).

  • randomString(len)

    Returns a random (safe) string with len characters.

Permission

Module that controls permissions accross the application. This module defines the following tables:

  • Permission

    A table that only lists existing permissions on the application, but doesn't grant them. Examples: 'read User', 'search Role', 'delete Permission'.

  • Role

    A table that lists existing roles on the application. Examples: User, Admin, Guest.

  • RolePermission

    A table with the columns role_id and permission_id that connects the Permission and Role tables by their entries IDs. Example: An entry { role_id: 1, permission_id: 4 } means that the Role with id = 1 will be granted the Permission with id = 4.

  • PermissionCache

    A "cache table" with the columns user_id, permission_id, section_id, permission, membership_id, membership_role_id, role_id and role_permission_id that puts all the relevant information to permissions together.

Section

Module that controls the sections and memberships of users across the application. This module defines the following tables:

  • Section

    A table that defines different sections of the application. (Users can have different permissions on different sections).

  • Membership

    A table to store the membership of users on each section and the status of the membership.

  • MembershipRole

    A table that links a membership to a role by their IDs.

User

The user module, that controls registrations, authentication and other user-related functionalities. This module defines the following tables:

  • User

    The basic entry of an user. Has the columns login, email, password, salt and status.

  • Token

    A table to store the authentication token of users. These tokens are used to identify the user making requests and must be sent on all requests that require authentication/permission to access.

Var

An auxiliary module that defines useful variables of the system. This modules defines the table Var, that stores these variables.