
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
advanced-pad
Advanced tools
Super lightweight and advanced padding module.
advanced-pad is a super light string padding function with advanced truncation and character padding support.
$ npm install advanced-pad
// include advanced-pad
var pad = require('advanced-pad');
// call a padding function
pad.padLeft(string, len, chr = ' ', trunc = false);
pad.padRight(string, len, chr = ' ', trunc = false);
- string = input string to pad
- len = iteger length to pad string to
- chr = string to use as padding character, can be multi
- trunc = true / false. Setting to true will retun the input string truncated from the left or right if it is longer than len.
// pad with '0' to left with length of 10
pad.padLeft('67454', 10, '0');
Output: 0000067454
// pad with '01' to left with legnth of 15
pad.padLeft('67454, 15, '01');
Output: 010101010167454
// pad with 'x' to right with length of 10
pad.padRight('test', 10, 'x');
Output: testxxxxxx
// pad to with 'x' to right, length of 5, with truncate
pad.padRight('testing', 4, 'x', true);
Output: test
MIT © Tyler Colwell
FAQs
Left and right string padding with advanced features.
We found that advanced-pad 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.