Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lpad

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lpad

Left pad each line in a string or stdout/stderr

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.2K
decreased by-76.52%
Maintainers
1
Weekly downloads
 
Created
Source

lpad Build Status

Left pad each line in a string or stdout/stderr.

The stdout/stderr padding is especially useful in CLI tools when you don't directly control the output.

screenshot

Getting started

Install: npm install lpad

Documentation

lpad(string, pad)

Pads each line in a string with the supplied pad string.

Example
var lpad = require('lpad');
var str = 'foo\nbar';

console.log(str);
/*
foo
bar
*/

console.log(lpad(str, '    '));
/*
    foo
    bar
*/

lpad.stdout(pad)

Pads each line of process.stdout with the supplied pad string until the method is called again with no arguments.

Example
var lpad = require('lpad');
var str = 'foo\nbar';

lpad.stdout('    ');  // start padding

console.log(str);
/*
    foo
    bar
*/

lpad.stdout();  // end padding

console.log(str);
/*
foo
bar
*/

lpad.stderr(pad)

Pads each line of process.stderr with the supplied pad string until the method is called again with no arguments.

License

MIT License (c) Sindre Sorhus

Keywords

FAQs

Package last updated on 06 Apr 2013

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc