0.1.9 • Published 10 years ago

generic-functions v0.1.9

Weekly downloads
9
License
MIT
Repository
github
Last release
10 years ago

generic-functions

Build Status Code Climate npm version Development Dependency Status

A generic function library for Node.js

Usage

To use, just add var g = require('generic-functions'); to your JavaScript file.

Functions offered:

g.strcmp(str1, str2); (Boolean)

Compare two strings (case-sensitive) to check if they match. Returns true or false.

g.icstrcmp(str1, str2); (Boolean)

(As g.strcmp(str1, str2);, but case-insenstive).

g.strendwith(str, suffix) (Boolean)

Check that str ends with suffix. Useful for checking file extensions (case-sensitive).

g.icstrendswith(str, suffix); (Boolean) (As g.strendswith(str, suffix);, but case-insensitive).

g_endswithdot(str); (String)

Get the last string part than ends with a dot suffix.

g.println(message); (Void)

A thin wrapper around console.log(...); print to stdout.

g.printlns(message); (Void)

Where message is an array such as ["Hello", "World"]. Print an array line-by-line to stdout.

g.objGetKeyByValue(object, value); (Object key as String)

Get an object's key by its value.

Install

$ npm install generic-functions

Optionally, you might want to include the -g option after install to make the functions available to all your Node.js modules.

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago