Socket
Socket
Sign inDemoInstall

egg-core

Package Overview
Dependencies
122
Maintainers
12
Versions
137
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.30.1 to 5.0.0

2

index.js

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

'use strict';
const EggCore = require('./lib/egg');

@@ -4,0 +2,0 @@ const EggLoader = require('./lib/loader/egg_loader');

11

lib/egg.js

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

'use strict';
const assert = require('assert');

@@ -10,8 +8,7 @@ const fs = require('fs');

const co = require('co');
const Router = require('@eggjs/router').EggRouter;
const BaseContextClass = require('./utils/base_context_class');
const utils = require('./utils');
const Router = require('@eggjs/router').EggRouter;
const Timing = require('./utils/timing');
const Lifecycle = require('./lifecycle');
const enableAsyncLocalStorage = !!require('async_hooks').AsyncLocalStorage;

@@ -44,3 +41,3 @@ const DEPRECATE = Symbol('EggCore#deprecate');

// https://github.com/koajs/koa/pull/1721
super({ asyncLocalStorage: enableAsyncLocalStorage });
super({ asyncLocalStorage: true });

@@ -77,3 +74,3 @@ this.timing = new Timing();

* @class Controller
* @extends BaseContextClass
* @augments BaseContextClass
* @example

@@ -94,3 +91,3 @@ * class UserController extends app.Controller {}

* @class Service
* @extends BaseContextClass
* @augments BaseContextClass
* @example

@@ -97,0 +94,0 @@ * class UserService extends app.Service {}

@@ -38,3 +38,3 @@ 'use strict';

* Same as {@link FileLoader}, but it will attach file to `inject[fieldClass]`. The exports will be lazy loaded, such as `ctx.group.repository`.
* @extends FileLoader
* @augments FileLoader
* @since 1.0.0

@@ -41,0 +41,0 @@ */

@@ -7,3 +7,2 @@ 'use strict';

const assert = require('assert');
const { Console } = require('console');

@@ -124,3 +123,3 @@ module.exports = {

// ignore console
if (key === 'console' && val && typeof val.Console === 'function' && val.Console === Console) {
if (key === 'console' && val && typeof val.Console === 'function' && val.Console === console.Console) {
obj[key] = filepath;

@@ -127,0 +126,0 @@ continue;

@@ -26,4 +26,4 @@ 'use strict';

* // options == app.config.status
* return function*(next) {
* yield next;
* return async next => {
* await next();
* }

@@ -30,0 +30,0 @@ * }

{
"name": "egg-core",
"version": "4.30.1",
"version": "5.0.0",
"description": "A core Pluggable framework based on koa",

@@ -15,4 +15,4 @@ "main": "index.js",

"test": "npm run lint -- --fix && npm run test-local",
"test-local": "egg-bin test",
"cov": "egg-bin cov",
"test-local": "egg-bin test -p",
"cov": "egg-bin cov -p",
"ci": "npm run lint && npm run cov",

@@ -36,27 +36,25 @@ "contributor": "git-contributor"

"engines": {
"node": ">= 8.9.0"
"node": ">= 14.17.0"
},
"devDependencies": {
"@types/depd": "^1.1.32",
"@types/koa": "^2.0.48",
"await-event": "^2.1.0",
"coffee": "^5.2.1",
"egg-bin": "^4.20.0",
"egg-bin": "^5.9.0",
"egg-utils": "^2.4.1",
"eslint": "^5.16.0",
"eslint-config-egg": "^7.4.1",
"eslint": "^8.31.0",
"eslint-config-egg": "^12.1.0",
"git-contributor": "^1.0.10",
"jest": "^24.8.0",
"js-yaml": "^3.13.1",
"mm": "^2.5.0",
"mz-modules": "^2.1.0",
"mm": "^3.2.1",
"pedding": "^1.1.0",
"rimraf": "^2.6.3",
"spy": "^1.0.0",
"supertest": "^4.0.2",
"ts-node": "^8.0.3",
"typescript": "^3.3.3333"
"ts-node": "^10.9.1",
"typescript": "^4.9.4",
"urllib": "^3.10.0"
},
"dependencies": {
"@eggjs/router": "^2.0.0",
"@types/depd": "^1.1.32",
"@types/koa": "^2.0.48",
"co": "^4.6.0",

@@ -63,0 +61,0 @@ "debug": "^4.1.1",

@@ -200,11 +200,12 @@ # egg-core

constructor(ctx) {
super(ctx);
// get the ctx
}
get() {}
async get() {}
};
// use the service in app/controller/home.js
module.exports = function*() {
this.body = this.service.query.get();
module.exports = async ctx => {
ctx.body = await ctx.service.query.get();
};

@@ -211,0 +212,0 @@ ```

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc