New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@chubbyts/chubbyts-framework

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chubbyts/chubbyts-framework

A minimal, highly performant middleware PSR-15 inspired function based microframework built with as little complexity as possible, aimed primarily at those developers who want to understand all the vendors they use.

Source
npmnpm
Version
1.6.8
Version published
Weekly downloads
139
24.11%
Maintainers
1
Weekly downloads
 
Created
Source

chubbyts-framework

CI Coverage Status Infection MSI npm-version

bugs code_smells coverage duplicated_lines_density ncloc sqale_rating alert_status reliability_rating security_rating sqale_index vulnerabilities

Description

A minimal, highly performant middleware PSR-15 inspired function based microframework built with as little complexity as possible, aimed primarily at those developers who want to understand all the vendors they use.

Workflow

Requirements

Installation

Through NPM as @chubbyts/chubbyts-framework.

npm i \
  @chubbyts/chubbyts-framework-router-path-to-regexp@^1.2.0 \
  @chubbyts/chubbyts-framework@^1.6.8 \
  @chubbyts/chubbyts-http@^1.0.0

Usage

App

import { createApplication } from '@chubbyts/chubbyts-framework/dist/application';
import { createErrorMiddleware } from '@chubbyts/chubbyts-framework/dist/middleware/error-middleware';
import { createRouteMatcherMiddleware } from '@chubbyts/chubbyts-framework/dist/middleware/route-matcher-middleware';
import { createGetRoute } from '@chubbyts/chubbyts-framework/dist/router/route';
import { createRoutesByName } from '@chubbyts/chubbyts-framework/dist/router/routes-by-name';
import { createResponseFactory } from '@chubbyts/chubbyts-http/dist/message-factory';
import { createPathToRegexpRouteMatcher } from '@chubbyts/chubbyts-framework-router-path-to-regexp/dist/path-to-regexp-router';
import { Response, ServerRequest } from '@chubbyts/chubbyts-http-types/dist/message';

const responseFactory = createResponseFactory();

const app = createApplication([
  createErrorMiddleware(responseFactory, true),
  createRouteMatcherMiddleware(
    createPathToRegexpRouteMatcher(
      createRoutesByName([
        createGetRoute({
          path: '/hello/:name([a-z]+)',
          name: 'hello',
          handler: async (request: ServerRequest): Promise<Response> => {
            const response = responseFactory(200);
            response.body.end(`Hello, ${request.attributes.name}`);

            return { ...response, headers: { ...response.headers, 'content-type': ['text/plain'] } };
          },
        }),
      ]),
    ),
  ),
]);

Server

Node

Running the application via the standard node http implementation.

npm i @chubbyts/chubbyts-node-http-bridge@^1.0.0

Check the Usage section.

Uwebsockets

Running the application via the uwebsockets http implementation. Linux only. Faster than the node implemenation.

npm i @chubbyts/chubbyts-uwebsockets-http-bridge@^1.0.2

Check the Usage section.

Skeleton

2023 Dominik Zogg

Keywords

chubbyts

FAQs

Package last updated on 11 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts