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

fwk

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fwk - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

35

lib/factory.js

@@ -29,2 +29,4 @@ // Copyright Teleportd

* Factory
*
* @param { logging, debug, name }
*/

@@ -35,4 +37,9 @@ var factory = function(spec, my) {

my.LOGGING = spec.logging || true;
my.DEBUG = spec.debug || false;
my.name = spec.name;
// public
var forward; /* forward(obj, type, evt); */
var log; /* log(str); */

@@ -49,4 +56,31 @@ // private

log = function(str, debug) {
if(!my.LOGGING) return;
var pre = '[' + new Date().toISOString() + '] ';
pre += (my.name ? '{' + my.name.toUpperCase() + '} ' : '');
pre += (debug ? 'DEBUG: ' : '');
str.split('\n').forEach(function(line) {
console.log(pre + line);
});
};
my.log = {
out: function(str) {
log(str);
},
error: function(err) {
log('*********************************************');
log('ERROR: ' + err.message);
log('*********************************************');
log(err.stack);
log('---------------------------------------------');
},
debug: function(str) {
if(my.DEBUG)
log(str, true);
}
};
base.method(that, 'forward', forward, _super);
base.getter(that, 'log', my, 'log');

@@ -64,3 +98,4 @@ return that;

* exports = factory({});
* exports = factory({ name: 'vacuum' });
* ```
*/

2

package.json
{
"name": "fwk",
"version": "1.0.3",
"version": "1.0.4",
"description": "Simple JS framework for node.js",

@@ -5,0 +5,0 @@ "keywords": ["fwk", "node"],

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