unjs / consola

🐨 Elegant Console Logger for Node.js and Browser
Other
6.12k stars 175 forks source link

feat: `consola.box` #193

Closed cpreston321 closed 1 year ago

cpreston321 commented 1 year ago

Context

Reference: https://github.com/unjs/citty/pull/21

In this PR I will introduce a new util function for creating a box kinda like boxen but without deps! This was initially created for unjs/citty but now moved to consola. Thanks @pi0 for the idea.

The functionality is less than boxen but will get the job done for now and we make it better eventually!

// API
await consola.banner("You have an update!", {
  title: "Update available!",
  padding: 2,
  valign: 'center',
  border: {
    color: "yellow",
    style: "rounded",
  },
})

Preview:

image

Thanks, CP 🚀

pi0 commented 1 year ago

Thanks! I have made few refactors:

cpreston321 commented 1 year ago

Thanks @pi0! I can't wait to use this!