Socket
Socket
Sign inDemoInstall

is-word-character

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-word-character

Check if a character is a word character


Version published
Weekly downloads
2.4M
increased by1.85%
Maintainers
1
Install size
6.00 kB
Created
Weekly downloads
 

Readme

Source

is-word-character

Build Coverage Downloads Size

Check if a character is a word character (\w, which equals [a-zA-Z0-9_]).

Install

npm:

npm install is-word-character

Use

var wordCharacter = require('is-word-character')

wordCharacter('a') // => true
wordCharacter('Z') // => true
wordCharacter('0') // => true
wordCharacter('_') // => true
wordCharacter(' ') // => false
wordCharacter('💩') // => false

API

wordCharacter(character|code)

Check whether the given character code (number), or the character code at the first position (string), is a word character.

License

MIT © Titus Wormer

Keywords

FAQs

Last updated on 25 Jan 2020

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