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

generator-tmj-module

v1.2.3

Published

TMJ Mean Stack Modules Generator

Readme

TMJ Mean Stack Module Generator

npm version

Mean Stack Module Generator using Yeoman

Table of Contents

Getting Started

You will need to install yeoman using npm. Be sure to have NodeJS installed before doing it so.

npm install yo -g

Locally

You need to download or clone this to a new project locally name it generator-tmj-module. Then run it in git shell.

git clone https://github.com/TMJPEngineering/generator-tmj-module.git > generator-tmj-module

Go to the root directory of this project, then type:

npm link

That will install this generator dependencies and symlink a global module to your local file. After npm is done your good to go to your project.

Globally

Or if you don't want to download or clone this, you can install it using npm:

npm install -g generator-tmj-module

List of Commands

Commands

Note:

  • [name] - Required
  • [module] - Required
  • [--option] - Optional
  • [--kind] - Optional
  • [--module] - Required

Creating a Module

To create a new module, you can simply run:

yo tmj-module:make [name] [--kind=value]

To create multiples modules, you can simply run by example:

yo tmj-module:make Blog Chat Post

Kinds

  • server
  • client

Creating an Angular Sub Module

To create a new sub module, you can simply run:

yo tmj-module:make-angular-submodule [name] [--module=value]

To create multiples modules, you can simply run by example:

yo tmj-module:make-angular-submodule Blog Chat Post --module=App

Creating an Angular Config

Create new angular config for the specified module.

yo tmj-module:make-angular-config [name] [module]

Creating an Angular Controller

Create new angular controller for the specified module.

yo tmj-module:make-angular-controller [name] [module]

Creating an Angular Directive

Create new angular directive for the specified module.

yo tmj-module:make-angular-directive [name] [module]

Creating an Angular Factory

Create new angular factory for the specified module.

yo tmj-module:make-angular-factory [name] [module] [--option=value]

Options:

  • plain

Creating an Angular Module

Create new angular module for the specified module.

yo tmj-module:make-angular-module [name] [module]

Creating an Angular Provider

Create new angular provider for the specified module.

yo tmj-module:make-angular-provider [name] [module]

Creating an Angular Service

Create new angular service for the specified module.

yo tmj-module:make-angular-service [name] [module]

Creating an Auth Module

Scaffold basic login and registration views.

yo tmj-module:make-auth --force

Creating a Controller

Create new controller for the specified module.

yo tmj-module:make-controller [name] [module] [--option=value]

Options:

  • rest
  • plain

Creating a Entity

Create new entity for the specified module.

yo tmj-module:make-entity [name] [module]

Creating a Job

Create new job for the specified module.

yo tmj-module:make-job [name] [module]

To dispatch a job, you need to require dispatch in a controller. For example in a controller:

var path = require('path'),
    root = path.dirname(require.main.filename),
    dispatch = require(root + '/vendor/dispatch');

module.exports = function (method) {
    var methods = { ... };

    return methods[method]();

    function name() {
        return function (req, res, next) {
            dispatch('Module::method', [req, res]);
        }
    }  
};

Creating a Middleware

Create new middleware for the specified module.

yo tmj-module:make-middleware [name] [module]

Creating a Routes

Create new routes for the specified module.

yo tmj-module:make-routes [name] [module] [--option=value]

Options

  • plain

Creating a Schema

Create new schema for the specified module.

yo tmj-module:make-schema [name] [module]

Creating a Test

Create new test for the specified module.

yo tmj-module:make-test [name] [module] [--kind=value]

Kinds

  • server
  • client

Creating a View

Create new html file for the specified module in views folder

yo tmj-module:make-view [name] [module]

To use view, you need to require view in a controller. For example in controller:

var path = require('path'),
    root = path.dirname(require.main.filename),
    view = require(root + '/vendor/view');

module.exports = function (method) {
    var methods = { ... };

    return methods[method]();

    function name() {
        return function (req, res, next) {
            view('module.name', res);
        }
    }
};

Folder Structure

Example:

Chat Module

yo tmj-module:make MyChat

or

yo tmj-module:make My-Chat
...
├── modules/
│   └── MyChat/
│       ├── Client/
│       │   ├── Config
|       │   │   └── mychat.config.js
│       │   ├── Controllers
|       │   │   └── mychat.controller.js
│       │   ├── Factories
|       │   │   ├── chat-manager.factory.js
|       │   │   └── chat-resource.factory.js
│       │   ├── Jobs
|       │   │   └── mychat.job.js
│       │   ├── Providers
|       │   │   └── mychat.provider.js
│       │   ├── Services
|       │   │   └── mychat.service.js
│       │   ├── Tests
|       │   │   └── mychat.test.js
│       │   └── user.module.js
│       └── Server/
│           ├── Controllers
|           │   └── mychat.controller.js
│           ├── Entities
|           │   └── mychat.entity.js
│           ├── Middlewares
|           │   └── mychat.middleware.js
│           ├── Routes
|           │   └── mychat.routes.js
│           ├── Schemas
|           │   └── mychat.schema.js
│           └── Tests
|               └── mychat.test.js
└── resources/
    └── views/
        └── mychat/
            └── index.html
...

Credits

License

This project is licensed under the MIT License - see the LICENSE for details

Copyright (c) 2017 TMJ Philippines