itwcw-lib

1.1.0 • Public • Published

ITWCWLib

A collection of Javascript utilities to streamline development.

Site | NPM Module | GitHub Repo

Installation

In a browser:

<script src="itwcw-lib.js"></script>

Using npm:

$ npm i itwcw-lib

Note: add --save if you are using npm < 5.0.0

In Node.js:

// Load the full build.
var itwcwlib = require('itwcw-lib');
 

Use

addPlural(word, n)

var numberOfCats = 1;
var numberOfDogs = 2;
console.log('I have ' + numberOfCats + itwcwlib.addPlural('cat', numberOfCats)) // I have 1 cat
console.log('I have ' + numberOfDogs + itwcwlib.addPlural('dog', numberOfDogs)) // I have 2 dogs

addArticle(word)

console.log('I have ' + itwcwlib.addArticle('dog')) // I have a dog
console.log('I have ' + itwcwlib.addArticle('animal')) // I have an animal

roundToNearest(n, roundTo)

console.log(itwcwlib.roundToNearest(10, 10)) // 10
console.log(itwcwlib.roundToNearest(11, 10)) // 10
console.log(itwcwlib.roundToNearest(15, 10)) // 20
console.log(itwcwlib.roundToNearest(19, 10)) // 20

objectLength(obj)

var jonSnow = {
  first_name: 'Jon',
  last_name: 'Snow',
}
console.log(itwcwlib.objectLength(jonSnow)) // 2

zeroFill(n, zeros)

var n1 = '9'
var n2 = '99'
var n3 = '999'
console.log(itwcwlib.zeroFill(n1, 3)) // 009
console.log(itwcwlib.zeroFill(n2, 3)) // 099
console.log(itwcwlib.zeroFill(n3, 3)) // 999

Why Use this Library?

itwcw-lib makes JavaScript easier by taking the hassle out of working with common issues such as finding days between dates, determining object length, and figuring out whether to add an 's' to something if it's plural.

Projects Using this Library

Somiibo: A Social Media Bot with an open-source module library.
JekyllUp: A website devoted to sharing the best Jekyll themes.
Slapform: A backend processor for your HTML forms on static sites.
SoundGrail Music App: A resource for producers, musicians, and DJs.
Hammock Report: An API for exploring and listing backyard products.

Leechii: A Telegram bot to manage your engagement groups.
Rankiir: A keyword tracker for search engines.
Keywordii: A keyword tracker for search engines.
Socialetto: A social media influencer search engine.

Readme

Keywords

Package Sidebar

Install

npm i itwcw-lib

Weekly Downloads

0

Version

1.1.0

License

ISC

Unpacked Size

16.3 kB

Total Files

6

Last publish

Collaborators

  • itwcw2000