Comments (1)
Hey, a bit late but here is an example how it could work (since no documentation I've done by reading code and trial).
const log = require("npmlog");
// Enable usage of progressbar.
log.enableProgress();
log.info("Progress example");
const longProcess = async () => {
const timeout = (ms) => {
return new Promise(resolve => setTimeout(resolve, ms));
}
// New progressbar.
const b = log.newItem("Something", 100);
for (let i = 1; i <= 10; i++) {
await timeout(2000);
// Diff of completed work.
b.completeWork(10);
log.info("Completed", i, b.completed());
}
b.finish();
};
longProcess();
// Logged before longProcess is done.
log.info("Done");
from npmlog.
Related Issues (20)
- [ISSUE] how to use npmlog in a script? HOT 2
- Reporting a vulnerability HOT 1
- How can I set up to display a complete error log?
- Setting string stack of some Errors causes `cannot set property stack`...
- Get the level numeric value? HOT 1
- Reentrancy, multiple instances? HOT 2
- npmlog error: log.gauge.isEnabled is not a function
- Latest version has broken node-gyp HOT 3
- Add Typescript definition 💜 HOT 2
- TypeError: log.gauge.isEnabled is not a function HOT 4
- Why resolve stack traces to plain string? HOT 2
- delete
- Install react-sripts and start react app on linux HOT 1
- [FEATURE] Disable log colors if environment variable is set HOT 3
- [BUG] v5.0.0 - Error: Cannot find module 'object-assign' HOT 2
- [BUG] Address CVE-2021-3807 HOT 3
- Resolve a moderate vulnerability in ansi-regex by updating to gauge ^4 HOT 4
- [BUG] Changelog not updated for v6 HOT 2
- Hide level, prefix in production HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from npmlog.