Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

formage

Package Overview
Dependencies
Maintainers
3
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formage

Admin GUI addon for mongoose and non mongoose projects on Express.js

  • 1.6.14
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25
increased by56.25%
Maintainers
3
Weekly downloads
 
Created
Source

Formage Build Status

Bootstraped Admin Forms for MongoDB via Mongoose, originally forked from mongoose-admin.

Usage

npm install formage

var express = require('express'),
    app = express();

require('formage').init(app, express [, models, options]);

Look at \example directory.

Options

// Site-wide options, and their default values
require('formage').init(app, express, models, {
    title: 'Admin',
    root: '/admin',
    default_section: 'main',
    username: 'admin',
    password: 'admin'
);
Model options
var model = new mongoose.model('songs', schema);

model.label = 'My Songs';
model.singular = 'Song';

// external files specific to this model
model.static = {
   js: [ '/js/songs.js' ],
   css: ['/css/songs.css' ]
};

// one-document models
model.single = true;

model.formage = {
    filters: ['artist', 'year'],

    // additional actions on this model
    actions: [
       {
          value: 'release',
          label: 'Release',
          func: function (user, ids, callback) {
             console.log('You just released songs ' + ids);
             callback();
          }
       }
    ],

    // list of fields to be displayed by formage for this model
    list: ['number', 'title', 'album', 'artist', 'year'],

    // list of order fields
    order_by: ['-year', 'album', 'number'],

    // list of fields that must be populated
    // (see http://mongoosejs.com/docs/api.html#document_Document-populate)
    list_populate: ['album'],

    // list of fields on which full-text search is available
    search: ['title', 'album', 'artist']
};
Field options
var schema = new mongoose.Schema({
    artist: { type: String, label: 'Who made it?' },
    // lang is a two letter ISO 639-1 code as recognized by google
    location: { type: Schema.Types.GeoPoint, widget_options: {lang: 'nl'}}
});

ISO 639-1

License

MIT

Sponsor

![](http://i.imgur.com/ynQ6c.png)

Keywords

FAQs

Package last updated on 12 Sep 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc