![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
pad
Advanced tools
Changelog
V1.1.0
Readme
Node Pad is a simple and elegant function to pad strings in both left and right directions.
pad('pad', 5) // "pad "
pad(5, 'pad') // " pad"
pad('pad', 5, '+') // "pad++"
pad(5, 'pad', '+') // "++pad"
Options are provided as a third argument and are all optional. A string argument it is interpreted as the "char" option. Accepted options include:
char
(string)colors
(boolean)require 'pad/lib/colors'
to avoid passing this option.strip
(boolean)pad(length, text, [options])
Left padding occurs when the first argument is a number and the second argument is a string.
var pad = require('pad');
pad(5, 'pad', '-').should.eql('-pad');
pad(text, length, [options])
Right padding occurs when the first argument is a string and the second argument is a number.
var pad = require('pad');
pad('pad', 6).should.eql('pad ');
Starting with version 1.1.0, Node pad rely on Node.js 4.0.0 or more recent. Stick to version 1.0.x if using an older version of Node.js.
Via npm:
npm install pad
Via git (or downloaded tarball), copy or link the project from a discoverable Node directory:
git clone http://github.com/wdavidw/node-pad.git
Clone the repo, install the development dependencies and run the suite:
git clone http://github.com/wdavidw/node-pad.git .
npm install
make test
FAQs
Left and right string padding
The npm package pad receives a total of 128,780 weekly downloads. As such, pad popularity was classified as popular.
We found that 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
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.