Socket
Socket
Sign inDemoInstall

ustring

Package Overview
Dependencies
3
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ustring

String utility functions


Version published
Weekly downloads
805
decreased by-6.29%
Maintainers
1
Install size
165 kB
Created
Weekly downloads
 

Readme

Source

String utility methods

Installation

npm install ustring

API

var ustring = require('ustring')

toLowerFirst

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

toUpperFirstFirst

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

hyphenate

ustring.hyphenate('ThisIsMyWord') == 'this-is-my-word'

humanize

ustring.humanize('This_is-a-very-long-sentence') == 'This is a very long sentence'

camelize

ustring.camelize('This-is-a-very-long-word') == 'ThisIsAVeryLongWord'

endsWith

ustring.endsWith('hello world','world') == true
ustring.endsWith('hello world','wor') == false
ustring.endsWith(123, 3) == true

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')

Tests

make

License

MIT

Keywords

FAQs

Last updated on 26 Sep 2014

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