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 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-angular-nmi

v2.1.4

Published

Yeoman generator for various AngularJS resources to encourage a common style within a project.

Downloads

8

Readme

Build Status Dependency Status Coverage Status

What this is (and isn't) about

  • It does generate various AngularJS resources (controllers, factories, routes, etc.) in a standard way, so that different developers of your project follow the same style.
  • It does not generate an AngularJS app scaffolding/structure for you. For this, you may use the excellent generator-gulp-angular.
  • It does follow a very opinionated style, mainly based on John Papa's excellent AngularJS styleguide. If you want different templates to apply your own team's styling, fork and replace the templates under templates folder.
  • It does not perform any kind of validation of your structure, conformance check to guidelines, linting, compression, merging, optimising, or anything of that sort.
  • Inspired by generator-ng-super.

Install

Install Yeoman:

npm install -g yo

Install generator:

npm install -g generator-angular-nmi

Internationalisation

All command-line output as well as all comments within the generated files can be customised by changing the lexicon file(s) under app/locales. The generator will automatically calculate the language to use based on your OS' language settings. In case a lexicon file is not available for your OS' locale, the default English one will be used.

Additional languages

Create a new JSON file under app/locales with the ISO 639 code of your locale. If you wish to contribute locales for another language please send a PR.

What is my current locale/language?

Locale/language discovery takes place using the os-locale library which practically looks into the value defined by any of env.LC_ALL, env.LC_MESSAGES, env.LANG,env.LANGUAGE (in that order).

Testing and coverage report

istanbul cover _mocha -- -R spec

Run

yo angular-nmi

Provides usage instructions.

Single-file generators

yo angular-nmi:constant

Generates: An AngularJS Constant.
Arguments: Output folder name, module name, constant name.
Template: constant.tpl.js

Examples

| Generator | Generates file | Module's name | Resource's name | | --------- | -------------- | ------------- | --------------- | | yo angular-nmi:constant src/app module1 system | src/app/system.constant.js | module1 | SystemConstant |

yo angular-nmi:controller

Generates: An AngularJS Controller.
Arguments: Output folder name, module name, controller name.
Template: controller.tpl.js

Examples

| Generator | Generates file | Module's name | Resource's name | | --------- | -------------- | ------------- | --------------- | | yo angular-nmi:controller src/app module1 system | src/app/system.controller.js | module1 | SystemController |

yo angular-nmi:factory

Generates: An AngularJS Factory.
Arguments: Output folder name, module name, factory/service name.
Template: factory.tpl.js

Examples

| Generator | Generates file | Module's name | Resource's name | | --------- | -------------- | ------------- | --------------- | | yo angular-nmi:factory src/app module1 control | src/app/control.service.js | app | ControlService |

yo angular-nmi:module

Generates: An AngularJS Module.
Arguments: Output folder name, module name, module filename.
Template: module.tpl.js

Examples

| Generator | Generates file | Module's name | | --------- | -------------- | ------------- | | yo angular-nmi:module src/app/foo app.foo.suppliers suppliers | src/app/foo/suppliers.module.js | app.foo.suppliers |

yo angular-nmi:route-ui

Generates: An AngularJS Route configuration using AngularUI Router.
Arguments: Output folder name, module name, routes name.
Template: route-ui.tpl.js

Examples

| Generator | Generates file | Module's name | | --------- | -------------- | ------------- | | yo angular-nmi:route-ui src/app module2 app | src/app/app.route.js | module2 |

yo angular-nmi:view

Generates: An HTML view.
Arguments: Output folder name, view name.
Template: view.tpl.html

Examples

| Generator | Generates file | | --------- | -------------- | | yo angular-nmi:view src/app edit | src/app/edit.html |

Group generators

yo angular-nmi:vc

Generates: A View and a Controller.
Arguments: Output folder name, module name, resources name.
Templates: view.tpl.html, controller.tpl.js

Examples

| Generator | Generates file | Module's name | | --------- | -------------- | ------------- | | yo angular-nmi:vc src/app app export | src/app/export.html, src/app/export.controller.js | app |