π A small collection of tools for the development of javascript & NodeJS.
Getting Started | API Docs | help & Support | Contribute
π¨βπ« This is a repository of utilities. What started out as a couple of ideas quickly turned into a class that grouped together various types of functionality. The intention of this package is to group a set of helpers and / or utilities, to facilitate routine work, especially related to Backend in node and webScraping.
π¬ Welcome to the JS PackTools documentation. It will help you get started fast. If you're having trouble, you can find help and answers on our Gitter channel. We have also incorporated a WhatsApp group, with the entire development team if you want to be part of it.
can you use by default npm
npm i js-packtools -S
or your can use yarn
yarn add js-packtools
Only instances the library and ready! Parentheses at the end allow you to pass values to the constructor.
const jsPackTools = require("js-packtools")();
//ready to be used... easy, right?
You can also order only the features you need. using By using the destructuring assignment method, we can simplify things even more.
const { capitalLetter, modStart } = require("js-packtools")();
You can use the jsPackTools.info().names
function to display a list of available functions
jsPackTools.info().names;
//"allEqual"
//"capitalLetter"
//"clearFolders"
//"createFolders"
//"csvToJson"
//"customDate"
//"dayOfYear"
//"deleteFile"
//"differenceDay"
//"everyOrNone"
//"formatSeconds"
// ...
Try it yourself in https://runkit.com/embed/47xmru66fj0s
Can use the name of function in info E.g. jsPackTools.info().customDate
This generates in response an object like this
{
category : "Time/Date"
description : "It's a date control. Without parameters give the current date, use the parameters to customize its functionality."
name : "customDate"
test : null
version : "1.0.0"
}
Try it yourself in https://runkit.com/embed/aqbxbxzkrkdw
In Js-PackTools each function fulfills a specific objective, but it can solve hundreds of different problems. Each function has its section in the documentation that will allow you to know in detail what the possibilities of said function are.
For example, the validateYear() function can have many implications. (see image)
The functions of this package are divided into categories. to make it easier to find a function that is out of line with your needs.
Functions Name | version | Category | Description |
---|---|---|---|
π± allEqual | 2.0.0 | Arrays/Object | This snippet checks whether all elements of the array are equal. |
π± everyOrNone | 1.0.0 | Arrays/Object | This snippet returns true if the predicate function returns true for a... |
π± groupBy | 1.0.0 | Arrays/Object | Sort the object by placing the value of the assigned property as key |
π± objectFilter | 1.1.2 | Arrays/Object | This fragment allows you to filter an object and return the key and it... |
Functions Name | version | Category | Description |
---|---|---|---|
π± capitalLetter | 2.0.0 | String | capitalize the first letter of a sentence or all letters if second par... |
π± modEnd | 1.0.1 | String | Using a string to create a new string with new size inverse to modStar... |
π± modStart | 1.0.1 | String | Using a string to create a new string with new size. |
Functions Name | version | Category | Description |
---|---|---|---|
π± clearFolders | 1.0.0 | Path/Files | This simply clear the content a folder. |
π± createFolders | 1.0.0 | Path/Files | This create a folder whit sub-folder of date by default if param `with... |
π± deleteFile | 1.0.0 | Path/Files | Check if the file exists before deleting |
π± getFinalPath | 1.0.0 | Path/Files | Create structure of folders with parameters in constructor. |
π± renameFiles | 1.0.0 | Path/Files | This function rename a batch of files with current date or token uniqu... |
π± validateDir | 1.0.0 | Path/Files | Validate if there is a route. if not, create this route. |
Functions Name | version | Category | Description |
---|---|---|---|
π± csvToJson | 1.0.0 | convert | This read a document CSV and convert in a Object Javascript (JSON). |
π± jsonToCsv | 1.0.1 | convert | Function for convert JSON to CSV |
Functions Name | version | Category | Description |
---|---|---|---|
π± customDate | 1.0.0 | Time/Date | It's a date control. Without parameters give the current date, use the... |
π± dayOfYear | 1.0.0 | Time/Date | This snippet gets the day of the year from a Date object. |
π± differenceDay | 1.0.0 | Time/Date | This simply clear the content a folder. |
π± formatSeconds | 1.0.1 | Time/Date | This only format a value float |
π± generateRageDate | 1.0.0 | Time/Date | This function allows you to separate a given date in the number of day... |
π± increaseDays | 1.0.0 | Time/Date | Add days to date, can defined a maxDate. |
π± objectToDate | 1.0.0 | Time/Date | Generate a object with date details. |
π± parseDate | 1.0.1 | Time/Date | Using a string and a format transform the string in date. |
π± timeToDate | 1.0.1 | Time/Date | return the time between two dates, or a date and now |
π± validateYear | 1.0.0 | Time/Date | Can be current year or spend the year to validate |
Functions Name | version | Category | Description |
---|---|---|---|
π± is | 1.0.1 | validate | Is a function for evaluate to type of element |
Functions Name | version | Category | Description |
---|---|---|---|
π± writeLog | 1.0.0 | global | write file .log in folder default of class. |
π± writeLogError | 1.0.0 | global | write file .log in folder default of class. |
π± log | 1.0.0 | global | It integrates the functions registry of errors and registry of executi... |
π± Completed
π₯ In Development
π¬ proposal
β deprecated
You can review the details of each function bif you have any questions about where to start contributing.y clicking on their links. for more information enter DocumentaciΓ³n API.
Take a look at our document CONTRIBUTING.md to start configuring the repository. If you are looking for something to contribute. You can review our project in Trello You can also contact our channel Gitter if you have any questions about where to start contributing.
Thanks to these people who have helped and motivated to improve this tool more and more.
Diego AndrΓ©s |
Gustavo Cacharuco |
JesΓΊs PΓ©rez |
this repository is under a license MIT
Copyright 2019 | All rights reserved to Jasp402