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

string-text-formatter

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

string-text-formatter

Format string text for seo friendly url slug, seo friendly url slug with unique id

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

string-text-formatter

Format string text for seo friendly url slug, seo friendly url slug with unique id

Install

$ npm install --save string-text-formatter	

Usage

import * as text from 'string-text-formatter';

// Remove all special characters and format string

const str = 'What is Lorem Ipsum?';

// Lower Case Method
const lowerCaseString = text.lowerCase(str);

console.log(lowerCaseString);
// what is lorem ipsum



// Upper case Method
const upperCaseString = text.upperCase(str);

console.log(upperCaseString);
// WHAT IS LOREM IPSUM



// Convert space using any character Method
const convertedString = text.convertString(str,'_');

console.log(convertedString);
// What_is_Lorem_Ipsum



// Seo friendly url slug method
const urlSlug = text.urlSlug(str);

console.log(convertedString);
// what-is-lorem-ipsum



// Seo friendly url slug with unique id method
const urlSlugUnqiue = text.urlSlugUnqiue(str);

console.log(urlSlugUnqiue);
// what-is-lorem-ipsum-1555935965905



// Generate random string method

// genetate alfhanumeric string
@params
length: total string length (Default 8)
allowSpecialCharacters: true / false
const string1 = text.randomString(12, false);

console.log(string1);
// xg7IqOAqo97v


const string2 = text.randomString(12, true);

console.log(string1);
// _HNu19-C^ohH

Keywords

FAQs

Package last updated on 26 Apr 2019

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