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
Readme
_ _ _ _____ _ | \ | | | | | __ \ | | | \| | ___ __| | ___ | |__) |_ _ __| | | . ` |/ _ \ / _` |/ _ \ | ___/ _` |/ _` | | |\ | (_) | (_| | __/ | | | (_| | (_| | |_| \_|\___/ \__,_|\___| |_| \__,_|\__,_| New BSD License
Node Pad is a simple function to pad strings in the left and right directions.
pad(text, size, [char])
: Left paddingNode Pad does left padding when the first argument is a string and the second argument is a number.
var pad = require('pad');
pad('pad', 6).should.eql('pad ');
pad(size, text, [char])
: Right paddingNode Pad does right padding when the first argument is a number and the second argument is a string.
var pad = require('pad');
pad(5, 'pad', '--').should.eql('--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
Via npm:
npm install pad
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 171,273 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.