New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jorge-salgado/url-generator

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

@jorge-salgado/url-generator

This URL generator module allows you to sanitize any string and generate a URL-friendly version of it.

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

URL Generator

How it works?

This URL generator module allows you to sanitize any string and generate a URL-friendly version of it.

You can use it to generate a URL-friendly version of any string, and it will remove all non-alphanumeric and special characters, protecting your application from any possible attacks like:

  • XSS (Cross-site scripting)
  • SQL injection

The folling characters will be remove:

|°¬!"#$%&/()=?'\¿¡´¨+~{}[]^`,;.:_@<>

Getting started

  • Install the module:
npm i @jorge-salgado/url-generator
  • Use the module:

const URL_GENERATOR = require('@jorge-salgado/url-generator');

URL_GENERATOR('String To Sanitize <script>alert(document.cookie)</script>');

//OUTPUT: 'string-to-sanitize-scriptalertdocumentcookiescript'


Or if you prefer it, you can use the modules individually

Sanitizer


const SANITIZER = require('@jorge-salgado/url-generator/modules/sanitizer');

SANITIZER('string to sanitize <script>alert(document.cookie)</script>');

//OUTPUT: 'string to sanitize scriptalertdocumentcookiescript'


URL Pattern


const URL_PATTERN = require('@jorge-salgado/url-generator/modules/urlPattern');

URL_PATTERN('String To Sanitize');

//OUTPUT: 'string-to-sanitize'


Keywords

FAQs

Package last updated on 27 Jan 2022

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