šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

@commitlint/ensure

Package Overview
Dependencies
Maintainers
4
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commitlint/ensure

Lint your commit messages

19.8.1
latest
Source
npm
Version published
Weekly downloads
4.2M
6.32%
Maintainers
4
Weekly downloads
Ā 
Created

What is @commitlint/ensure?

@commitlint/ensure is a utility package that provides functions to validate and ensure certain conditions on strings, such as checking if a string is a valid URL, if it matches a specific pattern, or if it adheres to a certain length. It is commonly used in conjunction with commitlint to enforce commit message conventions.

What are @commitlint/ensure's main functionalities?

isUrl

The `isUrl` function checks if a given string is a valid URL. In this example, it returns `true` for a valid URL.

const { isUrl } = require('@commitlint/ensure');

const result = isUrl('https://example.com');
console.log(result); // true

isLongerThan

The `isLongerThan` function checks if a given string is longer than a specified length. In this example, it returns `true` because 'hello' is longer than 3 characters.

const { isLongerThan } = require('@commitlint/ensure');

const result = isLongerThan('hello', 3);
console.log(result); // true

matches

The `matches` function checks if a given string matches a specified regular expression pattern. In this example, it returns `true` because 'hello' starts with 'h'.

const { matches } = require('@commitlint/ensure');

const result = matches('hello', /^h/);
console.log(result); // true

Other packages similar to @commitlint/ensure

Keywords

conventional-changelog

FAQs

Package last updated on 08 May 2025

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