Comparing version 0.0.1 to 0.0.2
{ | ||
"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 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
12286
16
266
2
3
1