Socket
Socket
Sign inDemoInstall

url-trim

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    url-trim

trims query and hash parameters off a URL


Version published
Weekly downloads
10K
increased by1.03%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

url-trim

stable

Trims query and hash parameters off of a URL.

Install

npm install url-trim --save

Example

var urlTrim = require('url-trim')

urlTrim('http://localhost:9966/?foo=bar')
//=> 'http://localhost:9966/'

urlTrim('/path/foo?blah#bar')
//=> '/path/foo'

Usage

NPM

trimmed = trim([url])

Trims the query string and hash parameters from a URL.

If url is empty or not a string, this method returns an empty string.

License

MIT, see LICENSE.md for details.

Keywords

FAQs

Last updated on 24 Sep 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc