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 🙏

© 2026 – Pkg Stats / Ryan Hefner

express-cool-admin

v1.1.0

Published

Generate admin panel for express app

Readme

express-cool-admin

A backend library for building admin applications running in the browser on top of express. It dose not depend on any database or orm.Open sourced and maintained by Alireza.

Features

  • Adapts to any database
  • Supports relationships by query field
  • Custom actions
  • Supports authentication with session apart from your user and your auth
  • cool ui

Installation

React-admin is available from npm. You can install it (and its required dependencies) using:

npm i express-cool-admin

Usage

import expressAdmin and use that like below:

// app.js
import express from 'express';
import expressAdmin from 'express-cool-admin';
import { userAdmin, carAdmin, companyAdmin } from './admin.js';

const app = express();

const config = {
    entities: [userAdmin, carAdmin, companyAdmin]
}

app.use('/admin', expressAdmin(config));

each entity most have schema like below:

// admin.js
export const userAdmin = {
    slug: 'user', // it used for url
    title: 'User', // it will shown to user
    icon: 'users', // font awesome icon name
    fields: { // data schema
        firstName: {
            type: 'text',
            title: 'First Name'
        },
        lastName: {
            type: 'long-text',
            title: 'Last Name'
        },
        phoneNumber: {
            type: 'number',
            title: 'Phone Number'
        },
        isActive: {
            type: 'bool',
            title: 'Is Active',
        },
        joinAt: {
            type: 'date',
            title: 'Join At',
            options: {
                format: 'YYYY/MM/DD HH:mm',
            }
        },
        role: {
            type: 'enum',
            title: 'Role',
            options: {
                map: {
                    'admin': 'Admin',
                    'manager': 'Manager',
                    'manager-assistant': 'Manager Assistant',
                },
                inputType: 'radio-inline',
            }
        },
        permissions: {
            type: 'multi-enum',
            title: 'Permissions',
            options: {
                map: {
                    'admin': 'Admin',
                    'manager': 'Manager',
                    'manager-assistant': 'Manager Assistant',
                },
                inputType: 'check-box-inline',
            }
        },
        picture: {
            type: 'file',
            title: 'Picture',
            options: {

            }
        },
        car: {
            type: 'query-multiple',
            title: 'Car',
            options: {
                onQuery: (q, page) => {
                    return {
                        "results": [
                            {
                            "id": '1',
                            "text": "Option 1"
                            },
                            {
                            "id": '2',
                            "text": "Option 2"
                            },
                            {
                            "id": '3',
                            "text": "Option 3"
                            }
                        ],
                        "pagination": {
                            "more": false
                        }
                    }
                },
                getLabel: (id) => {
                    return {
                        id,
                        text: 'Option ' + id
                    }
                }
            }
        }
    },
    listViewFields: ['firstName', 'lastName', 'phoneNumber', 'isActive', 'joinAt', 'role', 'permissions', 'picture'],
    listViewActions: [
        {
            id: 'delete-all',
            title: 'delete all',
        },
        {
            id: 'confirm-all',
            title: 'confirm all',
        },
        {
            id: 'suspend-all',
            title: 'suspend all',
        }
    ],
    onTriggerAction: (actionId, selectedItems) => {

    },
    getListItems: (page, filters) => {
        return {
            items: [ // this data could be provided from every where
            {
                _id: '1',
                firstName: 'foo',
                lastName: 'bar',
                phoneNumber: '09121010101',
                isActive: true,
                joinAt: new Date(),
                role: 'admin',
                permissions: ['admin', 'manager'],
                picture: 'http://lorempixel.com/200/200/people/'
            },
            {
                _id: '2',
                firstName: 'foo',
                lastName: 'bar',
                phoneNumber: '09121010101',
                isActive: true,
                joinAt: new Date(),
                role: 'admin',
                permissions: ['admin', 'manager'],
                picture: 'http://lorempixel.com/200/200/people/'
            },
            {
                _id: '3',
                firstName: 'foo',
                lastName: 'bar',
                phoneNumber: '09121010101',
                isActive: false,
                joinAt: new Date(),
                role: 'admin',
                permissions: ['admin', 'manager'],
                picture: 'http://lorempixel.com/200/200/people/'
            },
            {
                _id: '4',
                firstName: 'foo',
                lastName: 'bar',
                phoneNumber: '09121010101',
                isActive: false,
                joinAt: new Date(),
                role: 'admin',
                permissions: ['admin', 'manager'],
                picture: 'http://lorempixel.com/200/200/people/'
            },
            {
                _id: '5',
                firstName: 'foo',
                lastName: 'bar',
                phoneNumber: '09121010101',
                isActive: true,
                joinAt: new Date(),
                role: 'admin',
                permissions: ['admin', 'manager'],
                picture: 'http://lorempixel.com/200/200/people/'
            }
            ],
            totalPage: 6, 
        }  
    },
    getItem: (id) => {
        return { // this data could be provided from every where
            firstName: 'foo',
            lastName: 'bar',
            phoneNumber: '09121010101',
            isActive: true,
            joinAt: new Date(),
            role: 'admin',
            permissions: ['admin', 'manager'],
            picture: 'http://lorempixel.com/200/200/people/',
            car: ['2', '1'],
        }
    },
    addItem: (data) => {
        console.log(data);
        return 1;
    },
    editItem: (id, data) => {
        console.log(id, data);
        return 1
    },
    deleteItem: (id) => {
        return 1
    }
}

finally you can make admin db with make-admin-db script and add admin user with add-user-to-admin script

Contributing

Pull requests are welcome on the GitHub repository. Try to follow the coding style of the existing files, and include unit tests and documentation. Be prepared for a thorough code review, and be patient for the merge - this is an open-source initiative.

License

express-cool-admin is licensed under the MIT Licence, sponsored and supported by Alireza molaee.