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

npm-hublo-generator

v1.2.0

Published

The hublo tool suite to help you be more productive

Downloads

5

Readme

generator-medgo-suite [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]

The Hublo tool suite to help you be more productive

Installation

First, install Yeoman and npm-hublo-generator using npm (we assume you have pre-installed node.js).

npm install -g yo
npm install -g npm-hublo-generator

Then generate files using this generator, use one of these commands

# This creates all the files needed for the generated modules to work properly
# Only run this command once
yo hublo:init

# This creates all the files for a new model
# Router - Validator - Redux Store - Sequelize Model - Interfaces
yo hublo:create <modelName>


# Takes the attributes from the sequelize Model and adds:
# - The sequelize Init call
# - The fields required in the validator
# - The properties in the interface used in the front end
yo hublo:sync <modelName>

Init generated files

Here's all the files generated by the init command. Make sure your folder structer is similar to this or you'll have multiple time the same folder

.
|____server
| |____middleware
| | |____response
| | | |____sendResponse.middleware.ts # Middleware to send a response with a status, messages and data
| | | |____sendData.middleware.ts # Sends just the raw data in the response
| | |____security
| | | |____headerToToken.middleware.ts # Takes the authorization token and puts it in the req object
| | | |____medgoAuth.middleware.ts # Checks if the user is using a medgo access token
| | | |____auth.middleware.ts # Authenticates the user from the token in the req object
| | | |____queryParamToToken.middleware.ts # Takes the token in the query param of the URL requested and puts in the req object
| | |____utils
| | | |____bodyStringToQuery.middleware.ts # Parses the body.paramString string into parameters for the query generator (found in req.parameters)
| | | |____prepareResponse.middleware.ts # Adds to the res object multiple parameteres (necessary if using the sendResponse.middleware)
| |____module
| | |____validator # Folder for the validators
| | |____util
| | | |____error.ts # A module that helps with error formatting
| | |____auth
| | | |____auth.module.ts # A module with a get request to the API service to identify the user
| | |____query # Folder for the query module config
| |____sequelize # Folder for the sequelize models
| | |____DB.ts # connection to the database
| |____router
| | |____api # Folder for the rouer
|____Constant
| |____Api.constant.ts # Constants that are automatically updated by the sync function for possible fetch/post/update/delete
|____toolbox
| |____url
| | |____customParamGenerator.ts # Converts a JSON object into it's query string for the query module
| |____factory # Factories that listen for the sendResponse.middleware
| | |____fetchById.factory.ts
| | |____post.factory.ts
| | |____delete.factory.ts
| | |____update.factory.ts
| | |____fetch.factory.ts
| | |____postFetch.factory.ts
|____Model # Moduls with typescript interfaces
| |____Express.ts
| |____Admin.ts
| |____Readme.md
| |____Worker.ts
|____src
| |____service # Folder for the services generated
| |____store # Store files
| | |____store.type.ts
| | |____reducer
| | |____action
| | |____type

Create model

This method creates the model files. One time use when creating the modules.

Notes You have to import the store and the router yourself for them to be effective.

Sync model

Takes the attributes from the sequelize Model and adds:

  • The sequelize Init call
  • The fields required in the validator
  • The properties in the interface used in the front end

License

MIT © Khaled Romdhane <[email protected]>