Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

progress-loader-node

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

progress-loader-node

```sh $ npm i progress-loader-node ```

  • 1.1.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
249
increased by54.66%
Maintainers
1
Weekly downloads
 
Created
Source

Usage

Installation

$ npm i progress-loader-node

Example Loader

import { Loader } from 'progress-loader-node'

async function ConfigDB() {

  const loader = Loader.start(`Configurar la base de datos`)

  try {
    await new Promise(resolve => setTimeout(resolve, 3000))
    Loader.stop(loader)
  } catch (error) {
    Loader.stop(loader, true)
  }

}

ConfigDB()

Ejemplo

Example useLoader

import { useLoader } from 'progress-loader-node'

async function initDB() {
  await new Promise(resolve => setTimeout(resolve, 2000))
}

async function initControllers() {
  await new Promise((_, reject) => setTimeout(() => reject({ message: 'Tiempo de espera excedido' }), 2000))
}

async function initProcces() {
  await new Promise(resolve => setTimeout(resolve, 2000))
}

async function initServer() {
  await useLoader(initDB, 'Iniciar base de datos')
  await useLoader(initControllers, 'Iniciar Controladores')
  await useLoader(initProcces, 'Iniciar Procesos')
}

initServer()

Ejemplo

Example useLoaderWithError

import { useLoaderWithError } from 'progress-loader-node'

async function initDB() {
  await new Promise(resolve => setTimeout(resolve, 2000))
}

async function initControllers() {
  await new Promise((_, reject) => setTimeout(() => reject({ message: 'Tiempo de espera excedido' }), 2000))
}

async function initProcces() {
  await new Promise(resolve => setTimeout(resolve, 2000))
}

async function initServer() {
  await useLoaderWithError(initDB, 'Iniciar base de datos')
  await useLoaderWithError(initControllers, 'Iniciar Controladores')
  await useLoaderWithError(initProcces, 'Iniciar Procesos')
}

initServer()

Ejemplo

Keywords

FAQs

Package last updated on 15 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc