This package has been deprecated

Author message:

THIS MODULE IS DEPRECATED PLEASE USE: prose_isit, prose_string, prose_number, prose_promise, prose_array, prose_object, prose_log, prose_ip, prose_os, prose_file, prose_http

simple-short-pretty

1.0.3 • Public • Published

THIS MODULE IS DPRECATED PLEASE USE: prose-isit, prose-string, prose-number, prose-promise, prose-array, prose-object, prose-log, prose-ip, prose-os, prose-file, prose-http

Simplier, shorter, prettier NodeJS code, that is the goal of this library. You can now write code like: if(isNumber(xxx)) ... or while(isNotNil(obj)) ...it's well simplier, shorter, prettier.
Note, Nil is anything that is undefined or null inclusive.

Usage

cat(str1, str2 ... strN) joins the strings to one line with spaces btw. It will try and convert non string items to strings, this should work for primatives and non recursive objects.
getCommandLineArguments() return an array of all the command line inputs.
isArray(obj) false if undefined or null or not an array.
isBlankString(str) Returns true if input string is: UNdefined, NULL or empty string '' or a string with only tabs and space characters.
isBoolean(obj) false if undefined or null or not a boolean.
isDefined(obj) True if defined, including if value is null.
isEmptyString(str) Returns true if input string is: UNdefined or NULL or empty string ''.
isFunction (obj) if the input is a function returns true, undefined/null returns false.
isNil(obj) True if undefined or null.
isNotArray true if undefined or null or not an array.
isNotBlankString(str) Returns true if input string is defined, no NULL and has 1 or more non tab/space characters.
isNotBoolean(obj) true if undefined or null or not a boolean.
isNotDefined(obj) True if undefined.
isNotEmtpyString(str) Returns true if input string has 1 or more characters even if those characters are all spaces tabs etc.
isNotFunction (obj) if the input is a function returns false, undefined/null returns true.
isNotNil(obj) False if undefined or null.
isNotNumber(obj) true if undefined or null or not a number.
isNotObject true if undefined or null or not an object.
isNotString true if undefined or null or not a string.
isNumber(obj) false if undefined or null or not a number.
isObject(obj) false if undefined or null or not an object.
isString false if undefined or null or not a string.
Number2String(num) turn a known number into a string.
toNumber(str) convert the string passed in to a number. If a number is passed in, it is returned as is. If the string can not be returned as a number an error is thrown..
toString(obj, default) turn an object in to a string. If the input object is undefined, null or fails to convert then the default value is returned.
trimString(str) If the input string is null, undefined returns empty string. string is clean of any space/return/control characters at the begining and/or end of the string.

Install

npm install simple-short-pretty

Example

const SSP = require('simple-short-pretty');
if(SSP.isFuntion(somepossiblefunctionhere))...

Test

run tests...
npm test

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i simple-short-pretty

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

22.8 kB

Total Files

5

Last publish

Collaborators

  • seandmurray