![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
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*/);
Support Colors:
util.color.lightGreyBg('text')
util.color.lightCyanBg('text')
util.color.lightMagentaBg('text')
util.color.lightBlueBg('text')
util.color.lightYellowBg('text')
util.color.lightGreenBg('text')
util.color.lightRedBg('text')
util.color.lightBlackBg('text')
util.color.lightCyan('text')
util.color.lightMagenta('text')
util.color.lightBlue('text')
util.color.lightYellow('text')
util.color.lightGreen('text')
util.color.lightRed('text')
util.color.grey('text')
util.color.greyBg('text')
util.color.cyanBg('text')
util.color.magentaBg('text')
util.color.blueBg('text')
util.color.yellowBg('text')
util.color.greenBg('text')
util.color.redBg('text')
util.color.blackBg('text')
util.color.white('text')
util.color.cyan('text')
util.color.magenta('text')
util.color.blue('text')
util.color.yellow('text')
util.color.green('text')
util.color.red('text')
util.color.black('text')
util.color.dim('text')
util.color.bold('text')
util.color.underline('text')
util.color.blink('text')
util.color.inverse('text')
FAQs
An node logger for colorful with line info supported.
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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.