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

indefinite

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

indefinite

Prefix a noun with an indefinite article - a or an - based on whether it begins with a vowel

  • 2.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
167K
increased by1.61%
Maintainers
1
Weekly downloads
 
Created

What is indefinite?

The 'indefinite' npm package is used to determine the correct indefinite article ('a' or 'an') for a given word or phrase. This can be particularly useful in natural language processing, text generation, and other applications where proper grammar is important.

What are indefinite's main functionalities?

Basic Usage

This feature allows you to get the correct indefinite article for a single word. The function takes a word as input and returns the word prefixed with the correct indefinite article.

const indefinite = require('indefinite');
console.log(indefinite('apple')); // Output: 'an apple'
console.log(indefinite('banana')); // Output: 'a banana'

Handling Phrases

This feature allows you to get the correct indefinite article for a phrase. The function takes a phrase as input and returns the phrase prefixed with the correct indefinite article.

const indefinite = require('indefinite');
console.log(indefinite('hour of work')); // Output: 'an hour of work'
console.log(indefinite('unicorn in the garden')); // Output: 'a unicorn in the garden'

Custom Options

This feature allows you to customize the output, such as capitalizing the first letter of the article. The function takes a word or phrase and an options object as input and returns the word or phrase prefixed with the correct indefinite article, formatted according to the options.

const indefinite = require('indefinite');
console.log(indefinite('apple', { capitalize: true })); // Output: 'An apple'
console.log(indefinite('banana', { capitalize: true })); // Output: 'A banana'

Other packages similar to indefinite

Keywords

FAQs

Package last updated on 14 Jan 2019

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