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

nprogress

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nprogress

Simple slim progress bars

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is nprogress?

The nprogress npm package is a lightweight JavaScript library for creating slim and beautiful progress bars. It is often used to indicate the progress of page loads or asynchronous operations. The library is highly customizable and easy to integrate into web projects.

What are nprogress's main functionalities?

Basic Progress Bar

This code demonstrates how to start and complete the progress bar. `NProgress.start()` initiates the progress bar at the top of the page, and `NProgress.done()` completes the progress and removes the bar.

NProgress.start();
// Some loading process goes here
NProgress.done();

Setting a Specific Progress

This code snippet shows how to set the progress bar to a specific percentage. The `NProgress.set()` function takes a decimal number between 0 and 1 to set the progress accordingly.

NProgress.set(0.4); // Sets the progress bar to 40%

Incremental Progress

This demonstrates how to incrementally increase the progress bar. The `NProgress.inc()` function increases the progress by a small, random amount. This is useful for indicating progress when the exact time to completion is unknown.

NProgress.inc(); // Increments the progress bar by a little

Configuration

This code snippet shows how to configure the behavior and appearance of the progress bar. In this example, the minimum size of the bar is set to 10%, and the spinner is disabled.

NProgress.configure({ minimum: 0.1, showSpinner: false });

Other packages similar to nprogress

FAQs

Package last updated on 13 May 2015

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