Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

httf

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

httf - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

dist/Client.js

3

.vscode/settings.json
{
"licenser.license": "MIT",
"licenser.projectName": "HTTF"
"licenser.projectName": "HTTF",
"deno.enable": false
}
{
"name": "httf",
"version": "0.0.1",
"version": "0.0.2",
"description": "A modular Express-based web framework.",
"main": "dist/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "tsc",
"test": "jest"
},

@@ -25,3 +26,8 @@ "keywords": [

},
"public": true
"public": true,
"devDependencies": {
"@types/jest": "^24.0.21",
"jest": "^24.9.0",
"ts-jest": "^24.1.0"
}
}

@@ -1,3 +0,9 @@

import HTTFClient from './Client';
// Copyright (c) 2019 Hayden Young
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
import { RequestHandler, Router } from 'express';
import parseRoutePath from './util/paths';
interface ModuleInfo {

@@ -10,8 +16,18 @@ name: string;

public info: ModuleInfo;
public client: HTTFClient;
public router = Router();
public listeners = new Map<string, ((...args: any[]) => void)>();
constructor(info: ModuleInfo, client: HTTFClient) {
public constructor(info: ModuleInfo) {
this.info = info;
this.client = client;
}
public registerRoute(route: string, handler: RequestHandler) {
const res = parseRoutePath(route);
//@ts-ignore
this.router[res.method](res.path, handler);
}
public registerListener(event: string, listener: (...args: any[]) => void) {
this.listeners.set(event, listener);
}
}

@@ -8,2 +8,4 @@ {

"strict": true,
"types": ["node", "jest"],
"esModuleInterop": true

@@ -10,0 +12,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