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-fullstack-crud

v0.0.3

Published

Yeoman generator to add CRUD functionality to an angular-fullstack site

Downloads

6

Readme

generator-angular-fullstack-crud Build Status

Yeoman generator

Getting Started

Install Yeoman

$ npm install -g yo

Angular Fullstack CRUD

To install generator-angular-fullstack-crud from npm, run:

$ npm install -g generator-angular-fullstack-crud

Next, ensure you have a (mostly?) blank version of an angular-fullstack site. For best results, execute the generator against a completely fresh/new angular-fullstack site.

This can be accomplished by creating a new directory, and generating:

$ yo angular-fullstack

Next, create a config.json file to drive the crud generation. The angular-fullstack-crud generator comes with an example file, config.json. The only update required within this example is to correctly set the 'appName' property to whateve your angular-fullstack application is named. Here is an example of what this config might look like:

{
    "clean": true,
    "appName": "SampleApp",
    "globalModel":
    {
        "name": "String",
        "creation_datetime": "Date"
    },
    "entities": [
        {
            "name": "reservation",
            "model": {
                "headcount": "Number",
                "reservation_datetime": "Date",
                "guest_id": "ManualReference"
            }
        },
        {
            "name": "table",
            "model": {
                "capacity": "Number"
            }
        },
        {
            "name": "server",
            "model": {
                "name": "String",
                "table": "MongooseReference:Table"
            }
        },
        {
            "name": "guest",
            "model": {
                "favorite_meal": "String"
            }
        }
    ]
}

Copy that into the root of your new angular-fullstack site, and run the following:

$ yo angular-fullstack-crud

Using the values found in the config file, the generator will add views, controllers, models, etc to add the configured CRUD objects to your application. There are certain blocks of code that need to be injected into existing files (for example, the routes file). There are two ways the angular-fullstack-crud generator can accomplish this:

  • If being executed for the first time, it will look for certain code signatures in the newly generated angular-fullstack site, and inject there. It will also leave "markers" that it uses for subsequent generation.

  • If being executed again against a site, it will rely on the "markers" to know where to inject code. The markers will look something like this:

    // ROUTE INCLUDES BEGIN
    // ROUTE INCLUDES END

This process is a little fragile, and will work incorrectly if the existing angular-fullstack code looks differently than what the generator expects. For best results, use the "marker" paradigm, and code will always be injected into the correct place.

License

MIT