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

@dashup/module

v2.0.19

Published

nothing yet

Readme

Dashup Module · Latest Github release

A pluggable interface for creating functionality within dashup.

Contents

Get Started

Dashup uses a very simple interface system to build logic. Clone our default interface repo to get started:

  1. git clone [email protected]:dashupio/module-base.git .
  2. npm i
  3. npm run start

Page

Field

The field interface enables creating or extending custom fields within Dashup forms.

To create a field you'll first need to extend the field interface and set all of the data:

// import field interface
import { Field } from '@dashup/module';

/**
 * build address helper
 */
export default class ExampleField extends Field {

  /**
   * returns field type
   */
  static get type() {
    // return field type label
    return 'type';
  }

  /**
   * returns field data
   */
  static get data() {
    // return field data
    return {};
  }

  /**
   * returns object of views
   */
  static get views() {
    // return object of views
    return {
      input  : 'field/example/input',  // input view is required
      render : 'field/example/render', // input render is required
    };
  }

  /**
   * returns category list for field
   */
  static get categories() {
    // return array of categories
    return ['frontend'];
  }

  /**
   * returns field descripton for list
   */
  static get description() {
    // return description string
    return 'Field Descripton';
  }
}

Views

Fields must return an object of available riot views stored in /views in the root of this project. These views are automatically loaded and included when the field needs them in the Dashup frontend.

Altering tabs

  /**
   * returns object of data
   */
  static get data() {
    // return object of data
    return {
      tabs : ['Field', 'Validate'], // array of tabs to display in field modal
    };
  }

Registering views

  /**
   * returns object of views
   */
  static get views() {
    // return object of views
    return {
      input  : 'field/example/input',  // input view is required
      render : 'field/example/render', // input render is required

      // each subsequent view is loaded with it's associated tab in the `config` modal
      field    : 'field/example/field', // loaded into the `field` tab in the modal
      validate : 'field/example/validate', // loaded into the `field` tab in the modal
    };
  }

Methods

Fields also have 3 optional methods that enable extra functionality:

Sanitise

The Field Sanitise method returns different data compared to what is stored in the database for use in the frontend:

  /**
   * returns sanitised data from the database
   * 
   * @param {Object} { req, dashup }
   * @param {Object} field field config
   * @param {*} value stored value
   */
  async sanitise({ req, dashup }, field, value) {
    // return different data
    return {
      different : 'data',
    };
  }

Submit

The Field Sanitise method returns different data to be stored in the database:

  /**
   * returns database data from submitting the field
   * 
   * @param {Object} { req, dashup }
   * @param {Object} field field config
   * @param {*} value expected body value
   */
  async submit({ req, dashup }, field, value) {
    // return different data
    return {
      different : 'data',
    };
  }

Save

The Field Save method allows altering the field config when it's saved within a form:

  /**
   * hooks field alterations before saving to the database
   * 
   * @param {Object} { req, dashup }
   * @param {Object} field field config
   */
  async save({ req, dashup }, field) {
    // set different info
    field.different = true;
  }

Action

Trigger

Connect