New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

http4js

Package Overview
Dependencies
Maintainers
2
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http4js - npm Package Compare versions

Comparing version 3.2.2 to 4.0.0

core/Body.d.ts

2

client/HttpsClient.ts
import * as https from "https";
import {HeadersType, Req, Res, ResOf} from "../";
import * as fs from "fs";

@@ -11,3 +10,2 @@ export async function HttpsClient(req: Req): Promise<Res> {

method: req.method,
// ca: fs.readFileSync('src/ssl/my-root-ca.cert.pem'),
};

@@ -14,0 +12,0 @@

@@ -18,2 +18,2 @@ import { HttpMessage, HeadersType } from "./HttpMessage";

export declare function ResOf(status?: number, body?: string, headers?: HeadersType): Res;
export declare function Redirect(status: number | undefined, path: string, headers?: HeadersType): Res;
export declare function Redirect(status: number, path: string, headers?: HeadersType): Res;

@@ -24,3 +24,3 @@ import { Res } from "./Res";

private nestedRouting;
constructor(method: string, path: string, headers: HeadersType | undefined, handler: HttpHandler, name?: string);
constructor(method: string, path: string, headers: HeadersType, handler: HttpHandler, name?: string);
withRoutes(routes: Routing): Routing;

@@ -27,0 +27,0 @@ withRoute(req: Req, handler: HttpHandler): Routing;

@@ -128,3 +128,3 @@ "use strict";

.filter(function (it) { return it.handler !== it.routing.mountedNotFoundHandler; });
var match = matchedRouting[0] || { routing: this };
var match = matchedRouting[0] || { routing: this, handler: undefined };
var matchedHandler = match.handler || this.mountedNotFoundHandler;

@@ -131,0 +131,0 @@ if (matchedHandler.path.includes("{"))

@@ -80,3 +80,3 @@ import {Res} from "./Res";

.filter(it => it.handler !== it.routing.mountedNotFoundHandler);
const match = matchedRouting[0] || {routing: this};
const match = matchedRouting[0] || {routing: this, handler: undefined};
const matchedHandler = match.handler || this.mountedNotFoundHandler;

@@ -83,0 +83,0 @@ if (matchedHandler.path.includes("{"))

@@ -11,5 +11,7 @@ export * from "./core/Routing";

export * from "./servers/Server";
export * from "./servers/ExpressServer";
export * from "./servers/KoaServer";
export * from "./servers/NativeHttpServer";
export * from "./servers/NativeHttpsServer";
export * from "./client/Client";
export * from "./client/HttpClient";
export * from "./client/HttpsClient";
export * from "./zipkin/Zipkin";

@@ -14,5 +14,7 @@ "use strict";

__export(require("./core/Status"));
__export(require("./servers/ExpressServer"));
__export(require("./servers/KoaServer"));
__export(require("./servers/NativeHttpServer"));
__export(require("./servers/NativeHttpsServer"));
__export(require("./client/Client"));
__export(require("./client/HttpClient"));
__export(require("./client/HttpsClient"));
__export(require("./zipkin/Zipkin"));

@@ -12,7 +12,9 @@ export * from "./core/Routing";

export * from "./servers/Server";
export * from "./servers/ExpressServer";
export * from "./servers/KoaServer";
export * from "./servers/NativeHttpServer";
export * from "./servers/NativeHttpsServer";
export * from "./client/Client";
export * from "./client/HttpClient";
export * from "./client/HttpsClient";
export * from "./zipkin/Zipkin";
{
"name": "http4js",
"version": "3.2.2",
"version": "4.0.0",
"description": "A lightweight HTTP toolkit",

@@ -9,3 +9,3 @@ "main": "dist/index.js",

"build": "tsc",
"test": "tsc; mocha --require ts-node/register 'src/test/**/*.ts'",
"test": "mocha --require ts-node/register 'src/test/**/*.ts'",
"test-ssl": "tsc; mocha --require ts-node/register 'src/ssl/**/*.ts'",

@@ -27,2 +27,3 @@ "start": "ts-node src/main/index.ts"

"@types/node": "9.4.0",
"@types/node-fetch": "2.1.2",
"body-parser": "1.18.2",

@@ -29,0 +30,0 @@ "express": "4.16.3",

@@ -11,2 +11,9 @@ # http4js

### 4.0.0: ! Breaking change: drop support for Koa and Express backends
In order to evolve the core library faster support for Express and Koa backends
has been dropped. Happy to add back later.
### 3.2.2: bug fix: decodeURIComponent no longer called on response body.
### 3.2.0: Filters only apply per routing

@@ -121,9 +128,9 @@

- monorepo: breakout zipkin & httpclients to module (probably have in both core and separate module 'http4js-client')
- update example app
- withOptions
- convenience response methods eg ok()
- generalise routing to an interface, use totallylazy to implement new types of routing
- chain withHeaders calls on an http client
- streaming
- client side httpclient (from stu)
- streaming
- generalise routing to an interface, use totallylazy to implement new types of routing
- update example app
- reversible routing

@@ -130,0 +137,0 @@ - what happens if names conflict?

@@ -6,3 +6,3 @@ {

"declaration": true,
"strict": true,
// "strict": true,
"strictPropertyInitialization": false

@@ -9,0 +9,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc