Socket
Socket
Sign inDemoInstall

compound-subject

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compound-subject

A tiny JavaScript library for converting arrays of strings to compound subjects


Version published
Weekly downloads
24K
decreased by-9.08%
Maintainers
1
Weekly downloads
 
Created
Source

compound-subject

A tiny JavaScript library for converting arrays of strings to compound subjects

Installation

Node

In your project directory:

npm install --save compound-subject

At the top of your module:

var compoundSubject = require('compound-subject');

Bower

In your project directory:

bower install --save compound-subject

In your HTML:

<script src="bower_components/compound-subject/compound-subject.min.js"></script>

Or if you want the dev version:

<script src="bower_components/compound-subject/compound-subject.js"></script>

compoundSubject will be defined in the global scope (i.e. window).

Usage

compoundSubject(['apple', 'banana', 'cherry']).make();

// 'apple, banana and cherry'


compoundSubject(['apple', 'banana', 'cherry'])
	.endWith('or')
	.make();

// 'apple, banana or cherry'


compoundSubject(['apple', 'banana', 'cherry'])
	.delimitAll()
	.endWith('and maybe')
	.make();

// 'apple, banana, and maybe cherry'


compoundSubject([
	'a very crunchy Honeycrisp apple',
	'bananas at the pinnacle of ripeness',
	'delectable halved Rainier cherries'
]).delimitWith(';')
	.delimitAll()
	.make();

// 'a very crunchy Honeycrisp apple; bananas at the pinnacle of ripeness; and delectable halved Rainier cherries'

Keywords

FAQs

Package last updated on 15 Mar 2017

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