An obstrusive loading indicator for the terminal, reminiscent of Commodore 64's "decrunching"
npm install decrunch> An obstrusive loading indicator for the terminal, reminiscent of Commodore 64's "decrunching".


!GitHub branch check runs
``bash`
npm install decrunch
Wrap any async task with the loading animation:
`typescript
import { whileDecrunching } from './animation.js';
// Wrap any promise
const result = await whileDecrunching(
fetch('https://api.example.com/data'), {
// default options
border: 0,
fps: 25
}
);
`
Start and stop the animation manually:
`typescript
import { startDecrunching } from './animation.js';
const stopDecrunching = startDecrunching({
// default options
border: 0
fps: 30,
});
// Do your work...
await someTask();
stopDecrunching();
`
`shell`
npx decrunch sleep 3
Runs a loading animation while waiting for a promise to resolve.
Starts the animation and returns a function to stop it.
Both exported function accept the same options object:
Type: number
Default: 25
Border with on all sides.
Type: number`
Default: 25
Frames per second.
This work is licensed under The MIT License.