@faasjs/func 0.0.2-beta.266 → 0.0.2-beta.302

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  云函数模块。
4
4
 
5
- [![License: MIT](https://img.shields.io/npm/l/@faasjs/func.svg)](https://github.com/faasjs/faasjs/blob/master/packages/faasjs/func/LICENSE)
5
+ [![License: MIT](https://img.shields.io/npm/l/@faasjs/func.svg)](https://github.com/faasjs/faasjs/blob/main/packages/faasjs/func/LICENSE)
6
6
  [![NPM Stable Version](https://img.shields.io/npm/v/@faasjs/func/stable.svg)](https://www.npmjs.com/package/@faasjs/func)
7
7
  [![NPM Beta Version](https://img.shields.io/npm/v/@faasjs/func/beta.svg)](https://www.npmjs.com/package/@faasjs/func)
8
8
 
package/lib/index.es.js CHANGED
@@ -35,6 +35,7 @@ class RunHandler {
35
35
  }
36
36
  }
37
37
 
38
+ let startedAt = Date.now();
38
39
  class Func {
39
40
  /**
40
41
  * 新建流程
@@ -170,6 +171,10 @@ class Func {
170
171
  return {
171
172
  handler: async (event, context, callback) => {
172
173
  const logger = new Logger();
174
+ if (startedAt) {
175
+ logger.debug(`Container started +${Date.now() - startedAt}ms`);
176
+ startedAt = 0;
177
+ }
173
178
  logger.debug('event: %j', event);
174
179
  logger.debug('context: %j', context);
175
180
  if (typeof context === 'undefined')
package/lib/index.js CHANGED
@@ -39,6 +39,7 @@ class RunHandler {
39
39
  }
40
40
  }
41
41
 
42
+ let startedAt = Date.now();
42
43
  class Func {
43
44
  /**
44
45
  * 新建流程
@@ -174,6 +175,10 @@ class Func {
174
175
  return {
175
176
  handler: async (event, context, callback) => {
176
177
  const logger$1 = new logger.Logger();
178
+ if (startedAt) {
179
+ logger$1.debug(`Container started +${Date.now() - startedAt}ms`);
180
+ startedAt = 0;
181
+ }
177
182
  logger$1.debug('event: %j', event);
178
183
  logger$1.debug('context: %j', context);
179
184
  if (typeof context === 'undefined')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/func",
3
- "version": "0.0.2-beta.266",
3
+ "version": "0.0.2-beta.302",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -11,6 +11,10 @@
11
11
  "url": "git+https://github.com/faasjs/faasjs.git",
12
12
  "directory": "packages/func"
13
13
  },
14
+ "bugs": {
15
+ "url": "https://github.com/faasjs/faasjs/issues"
16
+ },
17
+ "funding": "https://github.com/sponsors/faasjs",
14
18
  "scripts": {
15
19
  "lint": "eslint --ext .ts src",
16
20
  "prepack": "rm -rf ./lib && rollup -c && mv lib/*/src/* lib/"
@@ -30,5 +34,8 @@
30
34
  "rollup-plugin-typescript2": "*",
31
35
  "typescript": "*"
32
36
  },
33
- "gitHead": "130df3f61ae3e69b3e2a3a484f557419a506ed0e"
37
+ "engines": {
38
+ "npm": ">=8.0.0"
39
+ },
40
+ "gitHead": "b53fb35a91369afd0185fb555d98e5c9d90b54bd"
34
41
  }