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

generator-angular-module-bp

v0.0.9

Published

An AngularJS module generator following John Papa's best practices guide

Downloads

24

Readme

generator-angular-module-bp

An AngularJS module generator following John Papa's best practices

Installation

First, install Yeoman and generator-angular-module-bp using npm (we assume you have pre-installed node.js).

npm install -g yo
npm install -g generator-angular-module-bp

Then generate your new project:

yo angular-module-bp

OR

yo angular-module-bp <module name>

###What is a Module An AngularJS module is what I would call the minimum required for a fully functional AngularJS application. Its file structure goes like this :

Exemple of a Doctor Module:
src
├── doctor
|   ├── views
|   |   ├── doctor.main.view.html
|   ├── doctor.module.js
|   ├── doctor.config.js
|   ├── doctor.run.js
|   └── doctor.controller.js

Now lets dive into the details.

####The Module File

the module file contains the declaration of the module only and is to be included in the index.html file before any use of the module in the project

(function() {
    "use strict";
    angular.module('doctor', []);
})();

####The configuration File

the configuration file will contain all the configuration required by the module to run properly

(function() {
    "use strict";
    angular
        .module('doctor')
        .config(configure);

    configure.$inject = [];
    function configure() {
    }

})();

####The run File

the run file will contain all code that will need to be run at the initialisation of the module (not always required but generated by default just in case)

(function() {
    "use strict";
    angular
        .module('doctor')
        .run(runBlock);

    runBlock.$inject = [];
    function runBlock() {

    }

})();

####The controller

the controller file will generate an empty controller with the name of the module to run as the main controller of the module or to be changed latter upon the user's needs.

(function() {
    "use strict";
    /**
     * Module: doctor
     * Controller: DoctorController
     * Description:
     * 
     */   angular.module('doctor').controller('DoctorController', DoctorController);

    function DoctorController() {

    }

})();

The Controller Generator

The controller generator is a generator that allows its user to generate extra controllers inside an already existing AngularJS Module

it is a sub generator that is automatically installed with the main generator and is to be run with the following commande

yo angular-module-bp:controller

and it will ask for the name of your module and the name of your controller and then generate a controller similar to the one generated by the module generator

Exemple:

What is the name of your main Module (Your APP)?app
What is the name of your module?doctor
What is the name of your new controller (lowercase without . or Controller)?new

this will generate the following

doctor.new.controller.js

(function() {
    "use strict";

    /**
     * Module: doctor
     * Controller: 
     * Description:
     * 
     */
    angular.module('doctor').controller('DoctorNewController', DoctorNewController);

    function DoctorNewController() {
    }
})();

Getting To Know Yeoman

Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced. Feel free to learn more about him.

License

MIT © Djadoun Mohamed Abderrezak