Socket
Socket
Sign inDemoInstall

wordwrap

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wordwrap

Wrap those words. Show them at what columns to start and stop.


Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created

What is wordwrap?

The wordwrap npm package is a utility for wrapping words to fit into specified columns. It can handle hard wraps (breaking words at the column limit) and soft wraps (breaking lines at spaces between words, respecting the column limit).

What are wordwrap's main functionalities?

Hard Wrapping

Hard wrapping breaks words that exceed the specified column width. This is useful when you want to ensure that no line exceeds the column limit, even if it means breaking words.

var wordwrap = require('wordwrap');
var wrappedText = wordwrap.hard(20)("The quick brown fox jumps over the lazy dog.");
console.log(wrappedText);

Soft Wrapping

Soft wrapping breaks lines at spaces, ensuring that words are not split. This is useful for text where preserving whole words on each line is important.

var wordwrap = require('wordwrap');
var wrappedText = wordwrap(20)("The quick brown fox jumps over the lazy dog.");
console.log(wrappedText);

Other packages similar to wordwrap

Keywords

FAQs

Package last updated on 07 May 2015

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