Socket
Socket
Sign inDemoInstall

rjweb-server

Package Overview
Dependencies
Maintainers
1
Versions
373
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rjweb-server - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

2

lib/index.js

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

}).on('end', async () => {
let reqUrl = url.parse(req.url);
let reqUrl = { ...url.parse(req.url), method: req.method };
if (reqUrl.path.endsWith('/'))

@@ -67,0 +67,0 @@ reqUrl.path = reqUrl.path.slice(0, -1);

/// <reference types="node" />
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "http";
import { UrlWithStringQuery } from "url";
declare const map: Map<any, any>;
export default interface ctr {
header: typeof map;
cookie: typeof map;
param: typeof map;
query: typeof map;
hostPort: number;
hostIp: string;
reqBody?: string | {
[key: string]: any;
/** A Map of all Headers */ header: Map<any, any>;
/** A Map of all Cookies */ cookie: Map<any, any>;
/** A Map of all Parameters */ param: Map<any, any>;
/** A Map of all Queries */ query: Map<any, any>;
/** The Port that the Client is using */ hostPort: number;
/** The Ip that the Client is using */ hostIp: string;
/** The Request Body (JSON Automatically parsed) */ reqBody: any;
/** The Requested URL */ reqUrl: UrlWithStringQuery & {
method: string;
};
reqUrl: UrlWithStringQuery;
rawReq: any;
rawRes: any;
error?: Error;
setHeader: (name: string, value: string) => ctr;
print: (msg: any) => ctr;
status: (code: number) => ctr;
printFile: (path: string) => ctr;
/** The Raw HTTP Server Req Variable */ rawReq: IncomingMessage;
/** The Raw HTTP Server Res Variable */ rawRes: ServerResponse;
/** The Error (If in the error event) */ error?: Error;
/** Set an HTTP Header to add */ setHeader: (name: string, value: string) => ctr;
/** Print a Message to the Client */ print: (msg: any) => ctr;
/** The Request Status to Send */ status: (code: number) => ctr;
/** Print the Content of a File to the Client */ printFile: (path: string) => ctr;
}
export {};
//# sourceMappingURL=ctr.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const map = new Map();
//# sourceMappingURL=ctr.js.map
import typesInterface from "../interfaces/types";
import ctr from "./ctr";
export default interface page {
array: string[];
path: string;
type: typesInterface;
addTypes: boolean;
code: (ctr: ctr) => any;
content?: any;
/** An Array of the URL split by slashes */ array: string[];
/** The URL as normal String */ path: string;
/** The HTTP Request Type */ type: typesInterface;
/** If true then some Content Types will be added automatically */ addTypes: boolean;
/** The Async Code to run on a Request */ code: (ctr: ctr) => void;
/** The File Content (If Preloading) */ content?: any;
}
//# sourceMappingURL=page.d.ts.map
{
"name": "rjweb-server",
"version": "1.1.4",
"version": "1.1.5",
"description": "Easy and Lightweight Way to create a Web Server in Node.js",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -97,3 +97,3 @@ import ctr from "./interfaces/ctr"

}).on('end', async () => {
let reqUrl = url.parse(req.url)
let reqUrl = { ...url.parse(req.url), method: req.method }
if (reqUrl.path.endsWith('/')) reqUrl.path = reqUrl.path.slice(0, -1)

@@ -100,0 +100,0 @@ let executeUrl = ''

@@ -0,24 +1,24 @@

import { IncomingMessage, ServerResponse } from "http"
import { UrlWithStringQuery } from "url"
const map = new Map()
export default interface ctr {
header: typeof map
cookie: typeof map
param: typeof map
query: typeof map
/** A Map of all Headers */ header: Map<any, any>
/** A Map of all Cookies */ cookie: Map<any, any>
/** A Map of all Parameters */ param: Map<any, any>
/** A Map of all Queries */ query: Map<any, any>
hostPort: number
hostIp: string
reqBody?: string | { [key: string]: any }
reqUrl: UrlWithStringQuery
/** The Port that the Client is using */ hostPort: number
/** The Ip that the Client is using */ hostIp: string
/** The Request Body (JSON Automatically parsed) */ reqBody: any
/** The Requested URL */ reqUrl: UrlWithStringQuery & { method: string }
rawReq: any
rawRes: any
/** The Raw HTTP Server Req Variable */ rawReq: IncomingMessage
/** The Raw HTTP Server Res Variable */ rawRes: ServerResponse
error?: Error
/** The Error (If in the error event) */ error?: Error
setHeader: (name: string, value: string) => ctr
print: (msg: any) => ctr
status: (code: number) => ctr
printFile: (path: string) => ctr
/** Set an HTTP Header to add */ setHeader: (name: string, value: string) => ctr
/** Print a Message to the Client */ print: (msg: any) => ctr
/** The Request Status to Send */ status: (code: number) => ctr
/** Print the Content of a File to the Client */ printFile: (path: string) => ctr
}

@@ -5,8 +5,8 @@ import typesInterface from "../interfaces/types"

export default interface page {
array: string[]
path: string
type: typesInterface
addTypes: boolean
code: (ctr: ctr) => any
content?: any
/** An Array of the URL split by slashes */ array: string[]
/** The URL as normal String */ path: string
/** The HTTP Request Type */ type: typesInterface
/** If true then some Content Types will be added automatically */ addTypes: boolean
/** The Async Code to run on a Request */ code: (ctr: ctr) => void
/** The File Content (If Preloading) */ content?: any
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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