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

ng-git-gen

v0.0.18

Published

Generates Angular (Module, Components and Routes) from static files in a git repo

Downloads

4

Readme

ng-git-gen

Generates Angular (Module, Components and Routes) from static files in a git repo

oclif Version Downloads/week License

Usage

$ npm install -g ng-git-gen
$ ng-git-gen COMMAND
running command...
$ ng-git-gen (-v|--version|version)
ng-git-gen/0.0.18 darwin-x64 node-v14.15.4
$ ng-git-gen --help [COMMAND]
USAGE
  $ ng-git-gen COMMAND
...

Commands

Install

npm i -g ng-git-gen

Options

-R, --global_route                             [default: false] Lazy route in
                                             app-routing

-a, --afterstrap=afterstrap                    Execute this on the content
                                             strings

-b, --bootstrap=bootstrap                      Execute this before collecting
                                             files with extension

-d, --git_dir=git_dir                          [default: tmp] Directory to
                                             clone git repo into

-e, --ext=ext                                  [default: .md] Extension, e.g.:
                                             '.md'

-f, --postprocess_content=postprocess_content  Function to run on content
                                             before conclusion, e.g.:
                                             replace("fo",
                                             "ba").replace("ca","ha"})

-g, --git_url=git_url                          (required) Git URL to use
                                             markdown from

-h, --help                                     show CLI help

-i, --extra_imports=extra_imports              Example: 'import {Foo} from
                                             bar;' will add this line, and
                                             `Foo` to `imports: []` in
                                             Module

-l, --list_route                               [default: true] Generate root
                                             route, listing all wiki links

-m, --global_route_mount=global_route_mount    [default: Value of route flag]
                                             If --global-route

-o, --output_ext=output_ext                    [default: .html] Output
                                             extension

-p, --project_dir=project_dir                  (required) angular project dir

-r, --route=route                              [default: wiki] Route, e.g.:
                                             /wiki

-s, --styleUrls=styleUrls                      styleUrls, if starts with http,
                                             then will download to generated
                                             dir & update styleUrl to this

-v, --verbosity=verbosity                      verbosity

--lifecycle=lifecycle                          Add lifecycle to
                                             component,e.g.: `--lifecycle
                                             AfterViewInit --lifecycle_init
                                             'console.info("AfterViewInit");
                                             throw Error("WOW")'

--lifecycle_init=lifecycle_init                Add lifecycle init to
                                             component. See `--lifecycle`
                                             for example.

--ng_project_name=ng_project_name              angular project name, defaults
                                             to first in angular.json

--version                                      show CLI version

Examples

Full workflow, with github wiki integration

$ ng new foo --routing --interactive=false
$ cd foo
$ mkdir src/app/wiki
$ ng-git-gen -p "$PWD" -g 'https://github.com/Fantom-foundation/fantom-dev-web.wiki.git' -l

This will populate src/app/wiki/generated. Next, you can include this in your src/app/app-routing.module.ts:

import { Routes } from '@angular/router';

const routes: Routes = [{ path: 'wiki', loadChildren: './wiki/generated/generated.module#GeneratedModule' }];

Github wiki generation

 ng-git-gen -p "$PWD" -g 'https://github.com/Fantom-foundation/fantom-dev-web.wiki.git' -l

RFC generation

ng-git-gen -p "$PWD" -g 'https://github.com/Fantom-foundation/fantom-rfcs' -l -b 'make html_body' -e '.html' -i "import { NgxPageScrollModule } from 'ngx-page-scroll';" -f '.replace(/href="#/g, `pageScroll href="#`)' -r rfc