Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
node-lancer
Advanced tools
【騎士道(きしどう)の剣(けん)に誉(ほま)れあれ! 俺(おれ)は、お前(まえ)と出会(であ)えてよかった!】 ---Lancer [Fate/zero night]
自古枪兵幸运E.
run this command: npm install --save
var util = require('node-lancer');
var logger = require('node-lancer/logger');
var debug = logger('myPkg');
var colors = require('node-lancer/color');
var timestamp = require('node-lancer/timestamp');
var type = require('node-lancer/type');
var md5str = util.md5('out put md5 string');
var escapedHTML = util.escapeHTML('<div></div>');
var unescapedHTML =util.unescapeHTML(escapedHTML);
var randomNum = util.random(10);
var randomNum = util.random(-1, 20);
var noBOMBuffer = util.tripBOM(buffer);
forEach, map, every, some, filter
same as the Array.prototype.{METHOD};
var list = util.{forEach|map|every|some|filter}(callback, /*context*/);
var arr = util.{toArray|arrayOf}(arguments); /*same as Array.of*/
util.merge is same as util.extend, util.clone is link util.extend(true, {}, target); Same as jQuery.extend;
trip special values to normal. 'NaN' => NaN 'Infinity'=> Infinity 'Null'=> null 'null'=> null 'false'=> false 'true'=> true
var camelVar = util.camelCase('this-should-be-camel-cased');
var data = {};
var namespace = 'a.b.c';
// get val;
var val = util.namespace(data, namespace);
// overwrite old value.
util.namespace(data, namespace, 'set value')
// extend new scope data.
util.namespace(data, 'a.b', {d:'don\'t overwrite data',e:'and add this'}, true);
Copied from the node/util
'YYYY': y, 'M': M, 'MM': pad(M), 'D': d, 'DD': pad(d), 'h': H%12, 'hh': pad(H%12), 'H': H, 'HH': pad(H), 'm': m, 'mm': pad(m), 's': s, 'ss':pad(s), 'S': SSS/100 | 0, 'SS': SSS/10 | 0, 'SSS': SSS, 'P': date > new Date(y,m,d,12,0,0,0) ? 'AM':'PM'
Example
var time = util.timestamp();
// output 2016-03-05 13:57:54
var lineInfo = util.line(/*number*/);
now using chalk instead.
FAQs
An node logger for colorful with line info supported.
The npm package node-lancer receives a total of 27 weekly downloads. As such, node-lancer popularity was classified as not popular.
We found that node-lancer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.