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-hilary

v1.9.1

Published

Yeoman generator for projects that use hilary IoC (DI)

Downloads

55

Readme

generator-hilary

Yeoman generator for projects that use hilary IoC (DI).

Getting Started

  • Dependencies:
    • node.js: brew install node for OSX, choco install node for Windows
    • Yeoman: npm install -g yo
  • Install: npm install -g generator-hilary
  • Run: yo hilary

Usage

  • yo hilary shows a wizard for generating Hilary modules
  • yo hilary --help shows flags and other configurable options

Generators

Generator choices with yo hilary

There are also several more sub generators

Node Hilary Module

Creates a new Hilary compatible Node file

Example:

? What do you want to create?
>Hilary Module :: Node
? What is the name of the Hilary scope?
>myScope
? What is the name of your module?
>myModule

Produces /myModule.js

/*jslint node: true*/
module.exports.name = 'myModule';
module.exports.dependencies = [];
module.exports.factory = function () {
    "use strict";
    
    
};

Browser Hilary Module

Creates a new Hilary compatible JavaScript file

Example:

? What do you want to create?
>Hilary Module :: Browser
? What is the name of the Hilary scope?
>myScope
? What is the name of your module?
>myModule

Produces /myModule.js

/*jslint node: true*/
/*globals Hilary*/
Hilary.scope('myScope').register({
    name: 'myModule',
    dependencies: [],
    factory: function () {
        "use strict";

        
    }
});

Cross Platform Hilary Module

Creates a new JavaScript file that is compatible with Hilary in Node and the Browser, and will put the output on Window if Hilary doesn't exist.

Example:

? What do you want to create?
>Hilary Module :: Cross Platform
? What is the name of the Hilary scope?
>myScope
? What is the name of your module?
>myModule

Produces /myModule.js

/*jslint node: true*/
/*globals Hilary, Window*/
(function (scope) {
    "use strict";

    var definition = {
        name: 'myModule',
        dependencies: [],
        factory: undefined
    };
    
    definition.factory = function () {
        // DEFINITION
    };
    
    if (Window && scope instanceof Window) {
        scope[definition.name] = definition.factory;
    } else if (typeof scope.register === 'function') {
        scope.register(definition);
    } else {
        scope.name = definition.name;
        scope.dependencies = definition.dependencies;
        scope.factory = definition.factory;
    }
    
}((typeof module !== 'undefined' && module.exports) ? module.exports : ((Hilary && Hilary.scope) ? Hilary.scope('myScope') : window)));

Hilary Express Router

Creates a new Express router that leverages Hilary

Example:

? What do you want to create?
>Hilary Express Router
? What is the name of the Hilary scope?
>myScope
? What is the name of your module?
>myRouter

Produces /myRouter.js

/*jslint node: true*/
module.exports.name = 'myRouter';
// Assumes you registered a router (the equivelant of express().Router())
module.exports.dependencies = ['router'];
module.exports.factory = function (router) {
    "use strict";

    /* GET home page. */
    router.get('/', function (req, res) {
        res.render('index', { title: 'myRouter' });
    });

    return router;
};

Hilary Gidget Router

Creates a new Gidget router that leverages Hilary

Example:

? What do you want to create?
>Hilary Express Router
? What is the name of the Hilary scope?
>myScope
? What is the name of your module?
>myRouter

Produces /myRouter.js

/*globals Hilary, console*/
Hilary.scope('myScope').register({
    name: 'myRouter',
    // Assumes you registered GidgetModule, locale and a viewEngine module
    dependencies: ['GidgetModule', 'locale', 'viewEngine'],
    factory: function (GidgetModule, locale, viewEngine) {
        "use strict";

        var $this = new GidgetModule();
        
        $this.get['/'] = function (params) {
            viewEngine.setVM({
                template: 't-empty',
                data: {
                    heading: locale.pages.home.empty.heading,
                    body: locale.pages.home.empty.body
                }
            });
        };

        return $this;
    }
});

Sub Generators

Available sub generators:

JavaScript

Creates a new JavaScript file

Example:

yo hilary:js myModule

Produces /myModule.js

(function () {
    "use strict";
    
}());

Grunt

Creates a new Grunt file

Example:

yo hilary:grunt gruntfile

Produces /gruntfile.js

/*jslint node: true*/
/*
This file is the main entry point for defining grunt tasks and using grunt plugins.
Click here to learn more. http://go.microsoft.com/fwlink/?LinkID=513275&clcid=0x409
*/
module.exports = function (grunt) {
    "use strict";
    
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json')
    });
    
};

GruntTask

Creates a new Grunt task file

Example:

yo hilary:gruntTask myTask

Produces /myTask.js

/*jslint node: true*/
module.exports = function (grunt) {
    "use strict";
    
    grunt.registerTask('myTask', '[DESCRIPTION]', function () {

    });
    
};

HTML

Creates a new HTML file

Example:

yo hilary:html myView

Produces /myView.html

<!DOCTYPE html>

<html lang="">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>myView</title>
    <meta name="description" content="" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>

</body>
</html>

JSON

Creates a new JSON file

Example:

yo hilary:json myJSON

Produces /myJSON.json

{

}

MarkDown

Creates a new MarkDown file

Example:

yo hilary:md myMarkDown

Produces /myMarkDown.md

myMarkDown
==========

Project Generators

Project generator choices are presented to you when you execute the projects sub generator.

  • yo hilary:projects shows a wizard for generating a new Hilary project

Generator choices with yo hilary:projects

Node Console Project

Creates a new Hilary compatible Node app with grunt, mocha and chai.

Example:

>yo hilary:projects
? What do you want to create?
>Node console project
? What is the name of your project?
>myProject
? What is the name of the Hilary scope?
>myScope

Produces a folder named after your project with the following directory structure:

- app
- build
    - tasks
- tests

Node Domain Project

Creates a new Hilary compatible Node domain library.

Example:

>yo hilary:projects
? What do you want to create?
>Node console project
? What is the name of your project?
>myProject
? What is the name of the first module you want to create?
>myModule

Produces a folder named after your project with the following file structure:

- index.js
- package.json
- myModule.js