
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
npm i tool-lib
All modules are asynchronous-based
如果你能看懂中文,那么你可以看包里的README_zh.md
const _tool=require('tool-lib');
const _tool=require('tool-lib/cep');
Remove null values from JSON
_tool.clearJsonNull(json);
Determine the incoming data type and return a string
_tool.dataType(obj);
Recursive creation of directories
_tool.mkdir(dir)
CEP version Recursive creation of directories
_tool.cep_mkdir(dir)
Converting Boolean values of strings to Boolean values
_tool.strBol(str)
const a='true'; console.log(typeof(_tool.strBol(a)));//booleanDetermine whether the specified position of the array is a number
_tool.arrIsNum(data,num)
Returns which array element appears in the string and returns the subscript of the array
_tool.arrIsNum(data,num)
How many decimal places to take
_tool.float(num,n[,option])
_tool.float(3.25335,2)//3.25_tool.float(3.25,4,0)//3.2500Returns the index of the closest value
_tool.nearIndex(arr,val)
index
let arr=[[3.56,4,5,2.25,8]];arr[await _tool.nearIndex(arr,1)]//2.25Compare the values in json, and return true if matched
_tool.compareJson(json,val)
trueHardware information of this machine
_tool.localHardwareInformation
const info=_tool.localHardwareInformation
info.ipv4 {ip,mac,netmask,cidr}info.ipv6 {ip,mac,netmask,cidr}FAQs
Common tools of JS
We found that tool-lib 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.