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

console-handler-arquitectura

v1.1.4

Published

To install the package you need to open the terminal of your code editor and run the command npm.

Downloads

5

Readme

Installation

To install the package you need to open the terminal of your code editor and run the command npm.

    npm install console-handler-arquitectura
const consoleHandler = require("console-handler-arquitectura")

Documentation

The main focus of the library is the JSON that is downloaded. As an example we can take the main screen:

{
"title": "Welcome to Main Screen! :D",
"name": "principalScreen",
"button": "principal",
"content": {
  "questions": [
    {
      "description": "Type the name of the button of the function you want to access",
      "message": "Select something valid",
      "name": "answer",
      "required": true
    }
  ],
  "OtherScreens": [
    {
      "title": "Create a person",
      "button": {
        "name": "create",
        "handler": "CreatePerson",
        "callScreen": "createScreen"
      }
    },
    {
      "title": "See all the persons",
      "button": {
        "name": "read",
        "handler": "ReadPerson",
        "callScreen": "readScreen"
      }
    },
    {
      "title": "Update a person",
      "button": {
        "name": "update",
        "handler": "UpdatePerson",
        "callScreen": "updateScreen"
      }
    },
    {
      "title": "delete a person",
      "button": {
        "name": "delete",
        "handler": "DeletePerson",
        "callScreen": "deleteScreen"
      }
    },
    {
      "title": "Exit",
      "button": { "name": "ex", "handler": "exit", "callScreen": "" }
    }
  ]
}

}

  • We need to have the name of the button of the screen we want to display.
  • In case the screen has questions, we need to enter content and questions.

Things to considerate:

  • You can only access the interfaces by entering the name of the buttons correctly (lower or upper case is irrelevant).
  • The command 'ex' terminates the execution of the program.
  • The other screens can be accessed through the main screen.

Methods

  • getquestions(button)

With this function we can get the questions we have inside a screen in the JSON file.

  • getAllScreen()

With this function we can get all the screens we have created in the JSON file returning them as an array.

  • getScreenByButton(button)

With this function we obtain the screen that we want to show in the console, First this screen has been created previously.

  • getScreenByScreenName(button)

With this function we obtain the screen that we want to show in the console introducing by a parameter the name of the screen

  • GetHandlerByButton(button)

With this function we obtain the handler that have the button inside

  • getOptionsColor(button, colorName, spaceBetweenTitleButton, functionTitle, functionButton)

With this function we can obtain access to the list of other screens that a screen has, we can have as an example the main screen that has access to the screenName and buttons of other screens.

"OtherScreens": [
    {
      "title": "Create a person",
      "button": {
        "name": "create",
        "handler": "CreatePerson",
        "callScreen": "createScreen"
      }
    },
    {
      "title": "See all the persons",
      "button": {
        "name": "read",
        "handler": "ReadPerson",
        "callScreen": "readScreen"
      }
    },
    {
      "title": "Update a person",
      "button": {
        "name": "update",
        "handler": "UpdatePerson",
        "callScreen": "updateScreen"
      }
    },
    {
      "title": "delete a person",
      "button": {
        "name": "delete",
        "handler": "DeletePerson",
        "callScreen": "deleteScreen"
      }
    },
    {
      "title": "Exit",
      "button": { "name": "ex", "handler": "exit", "callScreen": "" }
    }
]
  • consoleLogColor(color, text)

This function allows us to print in the console the text that we want next to the color that has been selected.

  • exportToJSON(nameFile, data)

With this function we can export the data to a JSON file.

  • changePathJSON(oldPath, newPath)

With this function we can move the exported file to the place of our preference, also it will create a history with the location where the file was moved to.