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

ustring

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ustring

String utility functions

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
456
increased by36.53%
Maintainers
1
Weekly downloads
 
Created
Source

String utility methods

Installation

npm install ustring

Methods & usage

var ustring = require('ustring')

ustring.toUpperFirst('name') == 'Name'
ustring.toLowerFirst('My Name') == 'my Name'

API

toLowerFirst

ustring.toLowerFirst('ABC') == 'aBC'

toUpperFirstFirst

ustring.toUpperFirst('abc') == 'Abc'

is.alphanum

ustring.is.alphanum('abcd09') == true
ustring.is.alphanum('abcd09#%#$') == false

is.match

ustring.is.match(/^[a-zA-Z0-9]+$/, 'abcd09') == true
ustring.is.match(/^[a-zA-Z0-9]+$/, 'abcd09#%#$') == false

Since match is a curried fn, you can even write

var matches = ustring.is.match(/^[a-zA-Z0-9]+$/)
matches('abc')

is.email

ustring.is.email('me@test.com') == true
ustring.is.alphanum('myemail.com') == false

License

MIT

Keywords

FAQs

Package last updated on 18 Aug 2014

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