smart-utils
Collection of util things
Usage
npm install smart-utils
Tagrize
Generate an tag name for HTML tags to angularjs components.
- Where
smartUtils
turns tosmart-utils
- Where
SmartUtils
turns tosmart-utils
- Where
ISmartUtils
turns toi-smart-utils
- Where
SmartUtilsAndEtc
turns tosmart-utils-and-etc
var smartUtils = ; var wordOne = "smartUtils";var wordTwo = "SmartUtils";var wordThre = "ISmartUtils";var wordFour = "SmartUtilsAndEtc"; console;console;console;console;
EnsureDirectoryExists
Ensure the directory exists
var smartUtils = ; { if error console; }; smartUtils; console;
Now EnsureDirectoryExists with promise
var Promise = ;var smartUtils = ; var ensureDirectoryExists = Promise; ;
With promise but Q lib
var Q = ;var smartUtils = ; var ensureDirectoryExists = Q; ;
With promise multi nivel path
var path = ;var Promise = ;var smartUtils = ; var ensureDirectoryExists = Promise; ;
ListDirectoryContentRecursive
List directory and file inside an directory recursively
var smartUtils = ; { iferror console; console; return; for var index = 0; index < resultlength; index++ var element = resultindex; console; }; smartUtils;
ListDirectoryContent
List directory and files inside an directory with options or no to list recursively
var smartUtils = ; { iferror console; console; return; for var index = 0; index < resultlength; index++ var element = resultindex; console; console;}; var options = recursive: true; // With options to recursivesmartUtils; // Without options, list just que first directory level smartUtils;
ObjectDeepFind
Get the value of an property deep into in a object, or not.
Do not ask me the utility of it ;D
var smartUtils = ; var dataObject = one: two: three: value: "This is the final value!" value: "This is not the final value! Go ahead!" value: "This is the second level value." value: "Yeap, first level value."; console;console;console;console;
ReplaceAll
Replace all found values at once, without regex ;D.
var smartUtils = ; var text = "object is a color, but object is a fruit to."; console;
News
- 0.0.1 Created the project, added tagrize function.
- 0.0.2 Added ensureDirectoryExists function.
- 0.0.3 Fix callback function of ensureDirectoryExists and added release to update npm package.
- 0.0.4 Added listDirectoryContentRecursive function.
- 0.0.5 Added objectDeepFind function.
- 0.0.6 Added replaceAll function.
- 0.0.7 Added listDirectoryContent function.
Thanks