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

is-lower

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-lower

Check whether a string is lowercase

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

is-lower (v1.0.1)

A simple utility to determine if a given string is in lowercase.

Installation

You can install is-lower using npm:

npm install is-lower

Usage

To use is-lower, require it in your application and call it with the string you want to check. The function will return true if the string is entirely in lowercase, and false otherwise.

const isLowerCase = require('is-lower');

console.log(isLowerCase("Hello"));       // false
console.log(isLowerCase("one"));         // true
console.log(isLowerCase("javascript"));  // true
console.log(isLowerCase("NODEJS"));      // false
console.log(isLowerCase("2024"));        // true
console.log(isLowerCase("hello world")); // true
console.log(isLowerCase("Hello World")); // false
console.log(isLowerCase("hello123"));    // true
console.log(isLowerCase("!@#$%"));       // true
console.log(isLowerCase("h3ll0"));       // true
console.log(isLowerCase(""));            // true (an empty string is considered lowercase)

// It can handle overrides
String.prototype.toLowerCase = () => false;
console.log(isLowerCase("hello world")); // true
console.log(isLowerCase("Hello World")); // false

// And non-strings
console.log(isLowerCase({})); // false
console.log(isLowerCase(-1)); // false

Keywords

FAQs

Package last updated on 18 Jul 2024

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