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

ngbuild

v1.0.2

Published

NGBUILD is lightweight tool for build your Angular.js app on the fly.

Downloads

29

Readme

NGBUILD

NGBUILD is lightweight tool for build your Angular.js app on the fly. Example project - https://github.com/galkinrost/angular-super-seed

Installation

For using from the comman-line install the package globally

npm install -g ngbuild

For using in the project

npm install --save ngbuild

Plugins

Grunt - https://github.com/galkinrost/grunt-ngbuild Gulp - https://github.com/galkinrost/gulp-ngbuild

Example

/app.js

angular.module('App',['controllers.js']);

/controllers.js

angular.module('App.controllers',[]);

result

angular.module('App.controllers',[]);
angular.module('App',['App.controlers']);

Usage

var ngbuild=ngbuild;
ngbuild.build({
	src:'app.js',
    dest:'app.build.js'
});

var content=ngbuild.buildSync({
	src:'app.js'
});

Templates

Both html and jade /app.js

angular.module('App',[],function ($routeProvider) {
    $routeProvider
        .when("/url1", {
            templateUrl: "template.html"
        })
        .when("/url2", {
            templateUrl: "template.jade"
        });
}).directive('html',function(){
	return{
    	templateUrl:"template.html"
    }
}).directive('jade',function(){
	return{
    	templateUrl:"template.jade"
    }
});	

result

angular.module('App',[],function ($routeProvider) {
    $routeProvider
        .when("/url1", {
            template: "<span>template.html</span>"
        })
        .when("/url2", {
            template: "<span>template.jade</span>"
        });
}).directive('html',function(){
	return{
    	template:"<span>template.html</span>"
    }
}).directive('jade',function(){
	return{
    	template:"<span>template.jade</span>"
    }
});	

CSS

/app.js

angular.module('App',[],function ($routeProvider) {
    $routeProvider
        .when("/url1", {
        	styles:"styles.css",
            templateUrl: "template.html"
        })
})
...

result

angular.module('App',[],function ($routeProvider) {
    $routeProvider
        .when("/url1", {
            template: "styles{font-size:10px}<span>template.html</span>"
        })
})
...

Folders

directives folder

/app.js
/directives
	/module.js
    /directive.js

/app.js

angular.module('App',['directives']);

/directive/module.js(!special name of file with module declaration)

angular.module('App.directives',[]);

/directives/directive.js

angular.module('App.directives')
	.directive('directive',function(){
    ...
    });

result

angular.module('App.directives',[]);
angular.module('App.directives').directive('directive',function(){
...
});
angular.module('App',['App.directives']);

Subfolders

directives folder

/app.js
/directives
	/module.js
    /directive/
    	directive.js
        template.html
        styles.css

/app.js

angular.module('App',['directives/*']);

/directives/directive/directive.js

angular.module('App.directives')
	.directive('directive',function(){
    	return{
    		templateUrl:'template.html',
            styles:'styles.css'
    	}
	});

External libs

/app.js

angular.module('App',['!/lib/jquery.js']);

result

/**
* JQUERY HERE
**/
angular.module('App',[]);

Pathes

  • relative - 'file_path'
  • absolute - '/file_path'
  • library - '!(/)file_path
  • subdirectory - (/)directory_path/*

License

MIT