Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisweb committed Apr 28, 2016
2 parents 3981c7c + f45bf21 commit 979ec42
Show file tree
Hide file tree
Showing 3 changed files with 764 additions and 708 deletions.
88 changes: 72 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,74 @@
chrisweb utilities.js 0.1.2
===========================

This project is not ready for use in production. It's still under heavy development. I wrote this for another project I work on right now, but its still far from being stable. Testing are fixes and comments are welcome.

main goal(s):
* console log wrapper for colored log messages
* utilities belt: javascript collection of useful functions that are useful for specific situations, so a lot more specific than underscore
* should work in the browser as well in nodejs

TODOs:
* use arguments in function to let user pass multiple variables as for original console log
* let user set color with argument color:color_name
* let user change environment with environment:environment_mode
* let user choose default color on initialization
* let user set environment on initialization
* silence console logs on production mode


Javascript utilities for small tasks. Testing are fixes and comments are welcome.

main goal(s):
* DONE: should workin the browser as well in nodejs
* DONE: console log wrapper for colored log messages

sub goal(s):
* create UMD build using grunt

# features

### utilities.log
Colored console log messages for the browser and or nodejs (iojs)
```
utilities.log('foo', 'bar', 'fontColor:red', 'backgroundColor:blue');
```
<br>
**Suppported colors**

* red
* green
* yellow
* blue
* magenta
* cyan
* white
* black
<br><br>
**logging in floating html div (client)**
If you are on mobile device and wan't to show the messages in a floating div over the page then set logSpecial to true
```
utilities.logSpecial = true
```
<br>
**logging in a file (server)**
If want every message to logged in file, then enable logSpecial (currently only winston is supported)
```
utilities.logSpecial = true
```
<br>
**logging in a file (server) but not in the console**
```
utilities.logSpecial = true
utilities.logVerbose = false
```
### removeElements
extracts html elements (and their content) from strings
### generateUUID
returns a universally unique identifier
### filterAlphaNumericPlus
filters a string
<br>
removes everything that is a not an alpha or numeric character and also optionally the characters that got specified as second argument
### decodeUri
decode uri
### encodeUri
encode uri
### arrayRemove
remove an something at an unknown index from an array
### capitaliseFirstLetter
capitalise first letter of a string
### getUrlParameters
get url parameters
### stringContains
does a string contain another string
### getSubstringIndex
get the index of a substring in a string with optional nth time it occurs
### isServer
does the script run on the server
### isClient
does the script run in a client
58 changes: 29 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"name": "chrisweb-utilities",
"version": "0.1.2",
"description": "chrisweb utilities",
"main": "utilities.js",
"scripts": {
"test": "grunt"
},
"repository": {
"type": "git",
"url": "https://github.com/chrisweb/chrisweb-utilities.js.git"
},
"keywords": [
"chrisweb",
"utilities",
"console",
"javascript",
"nodejs"
],
"author": "chrisweb",
"license": "MIT",
"bugs": {
"url": "https://github.com/chrisweb/chrisweb-utilities.js/issues"
},
"homepage": "https://github.com/chrisweb/chrisweb-utilities.js",
"devDependencies": {
"grunt": "^0.4.5"
}
}
{
"name": "chrisweb-utilities",
"version": "0.1.2",
"description": "chrisweb utilities",
"main": "utilities.js",
"scripts": {
"test": "grunt"
},
"repository": {
"type": "git",
"url": "https://github.com/chrisweb/chrisweb-utilities.js.git"
},
"keywords": [
"chrisweb",
"utilities",
"console",
"javascript",
"nodejs"
],
"author": "chrisweb",
"license": "MIT",
"bugs": {
"url": "https://github.com/chrisweb/chrisweb-utilities.js/issues"
},
"homepage": "https://github.com/chrisweb/chrisweb-utilities.js",
"devDependencies": {
"grunt": "^0.4.5"
}
}
Loading

0 comments on commit 979ec42

Please sign in to comment.