generic-functions
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/generic-functions package

0.1.9 • Public • Published

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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.94latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.94
0.1.80
0.1.70
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.01

Package Sidebar

Install

npm i generic-functions

Weekly Downloads

5

Version

0.1.9

License

MIT

Last publish

Collaborators

  • stpettersens