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 🙏

© 2026 – Pkg Stats / Ryan Hefner

summer-glove

v1.2.3

Published

[![npm version](https://img.shields.io/npm/v/npm-package.svg?style=flat)](https://www.npmjs.com/package/summer-glove) ## Fit like a glove 🧤 Summer-glove is a route manager, providing a quick and easy way to configure an express application. Summer-glo

Readme

Summer-glove

npm version

Fit like a glove 🧤

Summer-glove is a route manager, providing a quick and easy way to configure an express application. Summer-glove also provides 100% automated and customizable swagger documentation.

Installation and Usage

npm i summer-glove

To create a app

npx summer-glove --create-app

Will be create

project/
├── App.ts
├── Controller.ts
├── Server.ts
├── tsconfig.json

Add the property below to your file tsconfig.json.

{
    "compilerOptions": {
        //...
        "experimentalDecorators": true
        //...
    }
}

Documentation

Below is a walkthrough of all available decorators

Dependence inject Configuration:

Decorate your classes with these so that summer can manage the injection of your dependencies.
All context decorators (@Repository, @Service, @Component, @Configuration) receive an optional parameter. This parameter is used to allocate the instantiated object in the summer context; if not specified, it will be obtained from the class.

  • @Repository - Responsible for managing repository classes | String
  • @Service - Responsible for managing services classes | String
  • @Component - Responsible for managing components classes | String
  • @Configuration - Responsible for managing configurations classes | String
  • @Injectable - Responsible for injecting the object without attribute | String

Frist Configuration:

  • @StartControllers - Receives all the controllers of the application to initialize in the summer context | Object []
  • @SwaggerInitializer - Loads Swagger in your express application | String
  • @SwaggerEndpoint - Defines the path to access documentation | String
  • @ApiDefaultPath - Defines the main path of your API | String
  • @Description - Describes your application within documentation | String
  • @Title - Puts a title on your documentation | String
  • @Version - Defines API version | String
  • @GlobalAuth - Defines if the API uses JWT Tokens as a security mechanism | Boolean
    • Param:
      • AuthType.BEARER_JWT
      • AuthType.BASIC
  • @ExpressInitializer - Initializes an express app and configures its routes. You can also pass a logger configuration
    • Param:
      • LoggerConfigTypes.SHOW | LoggerConfigTypes.HIDE
      • app configuration:
        • Everything you want to pass to your express app. Example:
          • app.use( json() )
          • app.use( cors() )
        • Default configuration: app.use( json() )

Second Configuration

  • @Controller - Specifies a controller within the express context | String

Third Configuration

  • @Get - Specifies GET type endpoints | String, middlewares
  • @Post - Specifies POST type endpoints | String, middlewares
  • @Delete - Specifies DELETE type endpoints | String, middlewares
  • @Patch - Specifies PATCH type endpoints | String, middlewares
  • @Put - Specifies PUT type endpoints | String, middlewares
  • @Connect - Specifies CONNECT type endpoints | String, middlewares
  • @Head - Specifies HEAD type endpoints | String, middlewares
  • @Options - Specifies OPTIONS type endpoints | String, middlewares
  • @Trace - Specifies TRACE type endpoints | String, middlewares

Fourth Configuration

  • @StatusResponse - Adds HTTP response codes and description | number
  • @Body - Adds a Body as a request object | Object
  • @RequireAuth - Tells swagger that the route is protected by authentication
  • @ParamPath - Adds a ParamPath as a request object | Object
  • @FormData - Adds a FormData as a request objet | Object. Utilize FormDataTypes for grant types
  • @Header - Adds a Header as a request objet | object
  • @Query - Adds a Query as a request objet | object

Themes

To configure the themes, use

  • @Theme - Specifies Theme type of Swagger | If not specified, use default swagger theme
    • ThemesType.FEELING_BLUE
    • ThemesType.FLATTOP
    • ThemesType.MATERIAL
    • ThemesType.MONOKAI
    • ThemesType.MUTED
    • ThemesType.NEWS_PAPER
    • ThemesType.OUTLINE

Usage

Express & Swagger Configuration

import Express, {json} from "express";
import {
  ApiDefaultPath,
  Description,
  ExpressInitializer,
  GlobalAuth,
  AuthType,
  LoggerConfigTypes,
  SwaggerEndpoint,
  SwaggerInitializer,
  Theme,
  ThemesType,
  Title,
  Version,
  StartControllers
} from "summer-glove";
import MyController from "./Controller";
import cors from "cors";
import rateLimit from "express-rate-limit";
@SwaggerInitializer
@SwaggerEndpoint("/doc")
@Description("API TEST")
@Title("TEST NAME")
@Version("1.0.0")
@ApiDefaultPath("/")
@GlobalAuth(AuthType.BEARER_JWT)
@Theme(ThemesType.NEWS_PAPER)
@StartControllers(
    MyController1,
    MyController2
)
export default class App {

  @ExpressInitializer(LoggerConfigTypes.SHOW,
          cors(), // configuration applied in app.use()
          rateLimit({
            windowMs: 15 * 60 * 1000,
            max: 10,
            message: 'Too many requests from this IP. Please try again later.',
            standardHeaders: true,
            legacyHeaders: false,
          }), //configuration applied in app.use()
          json() //configuration applied in app.use()
  )
  private app: Express.Express;
  
  public getApp(): Express.Express {
    return this.app;
  }
}

Controller Configuration

@Controller("/controller1")
export default class MyController1 {
    
    //health-check
    @StatusResponse(200, "Check API successfully")
    @StatusResponse(400,"Check API unsuccessfully")
    @Get() // It is important to put the Http Method Decorator as the first configuration.
    public check(request: Request, response: Response): Promise<Response> {

        //... implementation

    }
}
@Controller("/controller2")
export default class MyController2 {
    
    //There are 3 ways to inject a dependency into the summer-glove, here they are:
    
    @Injectable()
    private myService: MyService

    @Injectable("myService")
    private myService2: MyService
  
    private myService3: MyService = new MyService();
    
    private myService4: MyService;
    
    constructor(){
        this.myService4 = new MyService()
    }
    
    @StatusResponse(202) // if you dont pass description, summer-glove add for you 
    @StatusResponse(400) // if you dont pass description, summer-glove add for you 
    @Body({email:"Description", password:"Description"})
    @Post("/login")// It is important to put the Http Method Decorator as the first configuration.
    public login( request: Request, response: Response): Promise<Response> {
       //... implementation
    }
    
    @StatusResponse(200) // if you dont pass description, summer-glove add for you 
    @StatusResponse(400)// if you dont pass description, summer-glove add for you 
    @Get("/", authorizationMiddleware)// It is important to put the Http Method Decorator as the first configuration.
    public read(request: Request, response: Response): Promise<Response> {
        //... implementation
    }

    @StatusResponse(200)// if you dont pass description, summer-glove add for you 
    @StatusResponse(400)// if you dont pass description, summer-glove add for you 
    @ParamPath({uuid: "Description"})
    @RequireAuth() // Tells swagger that the route is protected by authentication
    @Get("/find-by-uuid/{uuid}", authorizationMiddleware)// It is important to put the Http Method Decorator as the first configuration.
    public findByUuid(request: Request, response: Response): Promise<Response> {
        //... implementation
    }

    @StatusResponse(200)// if you dont pass description, summer-glove add for you 
    @StatusResponse(400)// if you dont pass description, summer-glove add for you 
    @Body({
        name : "Description",
        email : "Description",
        password: "Description"
    })
    // Default = "/" 
    @Post() // It is important to put the Http Method Decorator as the first configuration.
    public create(request: Request, response: Response): Promise<Response> {
        //... implementation
    }
    
    @StatusResponse(200)// if you dont pass description, summer-glove add for you 
    @StatusResponse(400)// if you dont pass description, summer-glove add for you 
    @Query({
        uuid:"Description"
    })
    // Default = "/" 
    @Post("/query-profile") // It is important to put the Http Method Decorator as the first configuration.
    public queryProfile(request: Request, response: Response): Promise<Response> {
        //... implementation
    }

    @StatusResponse(200)// if you dont pass description, summer-glove add for you 
    @StatusResponse(400)// if you dont pass description, summer-glove add for you 
    @Header({
        profileType:"Description"
    })
    // Default = "/" 
    @Post("/type-profile") // It is important to put the Http Method Decorator as the first configuration.
    public headerProfile(request: Request, response: Response): Promise<Response> {
        //... implementation
    }

    @StatusResponse(200)// if you dont pass description, summer-glove add for you 
    @StatusResponse(400)// if you dont pass description, summer-glove add for you 
    @FormData({
        img: FormDataTypes.FILE,
        name: FormDataTypes.STRING,
        rules: FormDataTypes.ARRAY,
        age: FormDataTypes.NUMBER,
        isMarried:FormDataTypes.BOOLEAN

    })
    // Default = "/" 
    @Post("/create-profile") // It is important to put the Http Method Decorator as the first configuration.
    public createProfile(request: Request, response: Response): Promise<Response> {
        //... implementation
    }
}
@Service()
export default class MyService {
    
    public doAnithing(): Promise<void> {
       //... implementation
    }
    
}

Theme examples

  • FEELING_BLUE alt text
  • FLATTOP alt text
  • MATERIAL alt text
  • MONOKAI alt text
  • MUTED alt text
  • NEWS_PAPER alt text
  • OUTLINE alt text

Contact

[email protected]