ink-progress-bar-pacman

0.0.3 • Public • Published

ink-progress-bar-pacman

Progress bar pacman style

Install

yarn add ink-progress-bar-pacman

Usage

import React from 'react'
import { render } from 'ink'
import ProgressBarPacman from 'ink-progress-bar-pacman'

const App = () => {
  const [current, setCurrent] = useState(0)

  useEffect(() => {
    const interval = setInterval(() => {
      setCurrent(current => {
        if (current > process.stdout.columns)
          clearInterval(interval)

        return current + 1
      })
    }, 100)

    return () => {
      clearInterval(interval)
    }
  }, [])

  return <ProgressBarPacman
    width={process.stdout.columns}
    percent={current / process.stdout.columns}
  />
}

render(<App />)

Readme

Keywords

Package Sidebar

Install

npm i ink-progress-bar-pacman

Weekly Downloads

2

Version

0.0.3

License

MIT

Unpacked Size

4.69 kB

Total Files

9

Last publish

Collaborators

  • tony-tsx