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

lodash.trim

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.trim

The lodash method `_.trim` exported as a module.

  • 4.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

What is lodash.trim?

The lodash.trim package is a utility library that provides a simple function to trim whitespace from the beginning and end of a string. It is part of the larger Lodash library, which is known for its utility functions for common programming tasks.

What are lodash.trim's main functionalities?

Trim whitespace from both ends of a string

This feature removes whitespace from both the beginning and the end of the input string.

const _ = require('lodash.trim');
const trimmedString = _.trim('  Hello World  ');
console.log(trimmedString); // 'Hello World'

Trim specific characters from both ends of a string

This feature allows you to specify characters to be trimmed from both ends of the input string.

const _ = require('lodash.trim');
const trimmedString = _.trim('-_-Hello World-_-', '_-');
console.log(trimmedString); // 'Hello World'

Other packages similar to lodash.trim

Keywords

FAQs

Package last updated on 16 Feb 2016

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