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

yama

v1.1.0

Published

Awesome node-mongoose dashboard, with love from LastRoom at México to you.

Downloads

77

Readme

Yet another mongoose admin

Awesome node-mongoose admin, with love from LastRoom at México to you.

Technologies

| Server | Client | |:--------:|:--------:| |express |Bootstrap | |mongoose |jQuery | |swig |html5shiv | |underscore|responseJS| |async | | |execSync | |

Screenshots

Alt tag

Alt tag

Try the demo at: http://yamajs.com/admin

Email: [email protected]

Password: password

How to install

$ npm install -g yama

Initialize your project admin database

$ yama init --database=whatever

This command ask for the host, database, port, user, password, email and password.

If you need help

$ yama --help

How to implements

Finally just write the next lines:

On your project main file add the next lines

//Initialize express app
var express = require('express');
var app = express();

//Initialize connection to mongo
var mongoose = require('mongoose');
mongoose.connect('mongodb://host:port/database');

...

var admin = require('yama');

// Run admin with options
admin.init({
    path: process.cwd(),
    express: app,
    mongoose: mongoose,
    models: [
        process.cwd() + '/move/models'
    ],
    url: '/admin',
    templates: process.cwd() + '/admin', // Optional
    media: process.cwd() + '/static/admin' // Optional
});

...
//Run app at any available port
app.listen(port);

Add models to admin

var admin = require('yama');

admin.add('users', 'User', UserSchema, {
    label: 'My users',
    list: ['fullName', 'active'],
    edit: ['fullName', 'active', 'role', 'emails'],
    fields: {
        fullName: {
            header: 'Full name',
            widget: 'text'
        },
        active: {
            header: 'Active',
            widget: 'checkbox'
        },
        role: {
            header: 'Roles',
            ref: 'Role',
            widget: 'select',
            multiple: true,
            display: 'name'
        },
        emails: {
            header: 'Emails',
            widget: 'csv',
            placeholder: 'Type an email...',
            pattern: '^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$'
        }
    },
    order: { //The attributes to order the results.
        createdAt: 1,
        active: 1
    },
    criteria: { //The attributes to decide what to show and what don't.
        active: true
    }
});

Functions

init

Run the admin site with options

Arguments

  • path: process.cwd(),
  • express: Express app initialized
  • mongoose: Mongoose connection app
  • models: Array with the routes where models are allocated
  • url: url for the admin site
  • templates: Admin site templates, argument optional
  • media: Admin site statics, argument optional

add

Add an model description to the admin site

Arguments

  • path
  • modelName
  • schema
  • options

## Widgets

  • select [aditional attributes: multiple as true or false]
  • text
  • textarea
  • checkbox
  • radio
  • csv

Ready go to your /admin and that's all

What's next?

Three features i think would be awesome for integrate by default on yama are:

  • Search filters by field
  • Graphics for lists
  • Order lists
  • Download lists as CSV

Questions?

Please write an issue at https://github.com/lastroom/yama/issues

Inspired and based on drywal.