helloiampau / node-spinner Goto Github PK
View Code? Open in Web Editor NEWA simple spinner for node cli
License: MIT License
A simple spinner for node cli
License: MIT License
This can be achieved easily by checking the following:
if (require('tty').isatty(0))
{
// interactive shell is active in here
}
Can we apply a color to the spinner?
Using chalk for instance?
With this code:
spinner.start();
console.log('Foo')
The result is:
/ Foo
"spinner this"
Ever new console.log, some part of spinner continue in terminal, how I solve this !!
thx
Issue: There is no package-lock.json or npm-shrinkwrap.json file uploaded to the GitHub repository https://github.com/helloIAmPau/node-spinner
Questions: We are conducting a research study on the lock files used in JS projects. We were curious:
For any publication or research report based on this study, we will share all responses from developers in an anonymous way. Both your projects and personal information will be kept confidential.
Rationale: NPM introduced package-lock.json and npm-shrimpwrap.json files to capture the exact dependency tree installed at any point in time. When package.json defines the required dependencies and their respective versions using semantic versioning (e.g., “express”: “^4.16.4”), npm always downloads the latest version of packages to satisfy the specified version ranges (e.g., 4.17.1)[1]. If the latest version of any package keeps changing and has backward incompatibility issues with previous versions, the project may have an inconsistent running environment and get intermittent failures. In such scenarios, it can be very difficult for developers to debug programs and settle down the software environment [2].
List of Risks:
Suggested Solution: Please fixate the dependencies by either specifying the exact library version in the package.json file or by uploading the package-lock.json or npm-shrinkwrap.json file to GitHub.
References:
https://docs.npmjs.com/cli/v7/configuring-npm/package-lock-json
https://blog.logrocket.com/why-you-should-use-package-lock-json/
2019. 10 npm Security Best Practices. https://snyk.io/blog/ten-npm-security-best-practices/.
Pronnoy Goswami, Saksham Gupta, Zhiyuan Li, Na Meng, and Daphne Yao. 2020. Investigating The Reproducibility of NPM Packages. In2020 IEEE International
2021. Npm Security Best Practices. https://bytesafe.dev/posts/npm-security-best-practices/#no9-deterministic-results.
I want to use the spinner so the user knows something is loading, but in the case of a shell command the animation just freezes and that makes it useless in some of my usecases.
Is there a workaround or am I missing anything?
Creating a childprocess and executing the command there doesnt help, as well as executing it in silent mode.
spinner.start()
shelljs.exec(my command that takes some seconds)
spinner.stop(true)
thanks already
This is a great library, thanks for it!
Is it possible to show the spinner and title in the current cursor position rather than bumping it down to a new line? I have an instance where I have some text already outputted in the line with process.stdout.write
, and when I start the spinner, it moves to a new line. Can I prevent this or is it not currently possible?
When running a process with a spinner, when interruptering (cmd + c) the spinner doesn't stop and forces continual execution
I'm having a flush error it seems -- the spinner doesn't show up until done is called. I'm calling start outside a promise and stop inside a promise for context.
Best,
Jon
Hello! First, thanks for this awesome spinner!
If there is a long processing block (like for) the spinner seems to disappear. Even if it was previously started.
Here is a gist: https://gist.github.com/raphaklaus/7b3c95346ba424cc735bc88bf4f14950
For happy fun-spins!
Any reason as to why the code that we get from npm
is different than the source found here? If this was a larger library I'd say that's quite misleading as it could contain malicious code that's not easily found.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.