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 🙏

© 2025 – Pkg Stats / Ryan Hefner

justrox-tent

v1.3.8

Published

MEAN stack API framework

Readme

justrox-tent

REST API framework. Automatically creates API endpoints for Mongoose models.

Installation

npm install justrox-tent --save

Getting Started

1. Creating a server


var app = require('express')();
var tent = require('justrox-tent');

/*
 ...
  Model definitions
  ....
*/

//Initialize server
tent.init(app,function()
{
    app.listen(3000);
});

2. Defining models

In this example we will create a user model.

const Model = tent.Model;

//Create a new model
const UserTentModel = Model.new("user");

//Define the model.  
UserTentModel.define({

  //Define model schema. This is almost the same with mongoose schema definitions
  schema:
  {
    name: String,
    rank: Number
  }
  
  //Define model field permissions
  permissions:
  {
     _id: 1,
     name: 7,   // readable, writable, editable - See permissions below
     rank: 1,   // read only field
  },
  
  //Define the required fields for the model
  required: ["name"]
  
});


//Compile the model. Once compiled the mongoose model will become available.
UserTentModel.compile();

3. Accessing model

Once tent.init() has been called, the API routes will be available at [host]:[port]/api

3.1 List all documents for the user model defined above.

[GET] /api/user

3.2 Get a specific document with id=5cc7c58ac657d641ecadea34

[GET] /api/user/5cc7c58ac657d641ecadea34

3.3 Add new document

[POST] /api/user

3.4 Edit a document

[PUT] /api/user/5cc7c58ac657d641ecadea34

3.5 Delete a document

[DELETE] /api/user/5cc7c58ac657d641ecadea34

4. Customization

To extend functionalities of the framework

4.1 Permissions

You can define if a certain field of a model can be read, updated or deleted.

Value | View | Add | Edit --- | --- | --- | --- 0 | 0 | 0 | 0 1 | 1 | 0 | 0 2 | 0 | 1 | 0 3 | 1 | 1 | 0 4 | 0 | 0 | 1 5 | 1 | 0 | 1 6 | 0 | 1 | 1 7 | 1 | 1 | 1

This is particularly useful when trying to hide values or restrict access to the field.

 ... 
 permissions: 
 {
    _id : 1, //readonly field
    name: 7, //full access field
    password: 6, // can be initialized and modified, 
                 // but can not be viewed.
    
 }
 ...
4.2 Mongoose Models

...

4.2.1 Virtual Fields

.

4.2.2 Populate Fields

...

4.2.3 Methods

...

4.3 Custom Routes

...

4.3.1 Override routes

...

4.3.2 Routes API

...

4.3.3 Extend routes

...

4.3.4 Child endpoint routes

...