pulse-express.js 1.0.4 → 1.1.0

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.
Files changed (2) hide show
  1. package/Functions.js +15 -4
  2. package/package.json +1 -1
package/Functions.js CHANGED
@@ -1,15 +1,26 @@
1
1
  var functions = {};
2
+ let startTime = null;
2
3
 
3
4
  function pulse() {
4
5
  return functions;
5
6
  }
6
7
 
8
+ // 1. Still handles the creation, but silently marks the time
7
9
  functions.CreateServer = function() {
8
10
  const http = require('http');
9
-
10
- // This creates the server object but DOES NOT start it.
11
- // It will sit idle until .listen() is called elsewhere.
12
- return http.createServer();
11
+ startTime = new Date().toLocaleTimeString();
12
+ return http.createServer();
13
+ };
14
+
15
+ // 2. THE NEW FUNCTION: Just returns the stored time
16
+ functions.ServerStartedTime = function() {
17
+ return startTime || "Server has not been created yet!";
18
+ };
19
+
20
+ // 3. The lowercase listen function we made earlier
21
+ functions.listen = function(serverInstance, port, callback) {
22
+ serverInstance.listen(port, callback);
13
23
  };
14
24
 
15
25
  module.exports = pulse;
26
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pulse-express.js",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "A lightweight request timer for Express apps Credits to express",
5
5
  "main": "Functions.js",
6
6
  "keywords": [