npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

js-packtools

v2.3.18

Published

:notebook_with_decorative_cover: A small collection of tools for the development of javascript.

Downloads

1,895

Readme



🤷‍ What is JS-PackTools?

👨‍🏫 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.

Requirement

Installation

can you use by default npm

npm i js-packtools -S

or your can use yarn

yarn add js-packtools

how is it used

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")();

- List available functions

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

- See a details of the functions

Can use the name of function in info E.g. jsPackTools.info().customDateThis 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

- Using one of these functions

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) carbon (4)

Content list

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.


🧾 Arrays/Object

| 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... |

✍ String

| 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. |

📁 Path/Files

| 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. |

↔ convert

| 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 |

⏰ Time/Date

| 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 |

✔ validate

| Functions Name | version | Category | Description | |---|---|---|---| |🌱 is | 1.0.1 | validate | Is a function for evaluate to type of element |

🌐 global

| 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... |


:seedling: Completed :fire: In Development :speech_balloon: 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.

contributor

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 |

License

this repository is under a license MIT Copyright 2019 | All rights reserved to Jasp402