Giter Site home page Giter Site logo

golota60 / yayfetch Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 1.0 6.42 MB

🧁 Node.js multi-platform screenfetch

Home Page: https://www.npmjs.com/package/yayfetch

License: MIT License

JavaScript 36.42% TypeScript 63.37% Shell 0.20%
screenfetch neofetch osinfo aesthetics unixporn terminal javascript linux macos windows

yayfetch's Introduction

downloads

Yayfetch

🧁Multi-platform customizable screenfetch tool🧁



Yayfetch is a tool similar to screenfetch, it just displays info about your computer in a prettified format - except you can use it on a non-linux machine via npx, thanks to the wonders of node

Usage

Yayfetch works both with npx and bunx

  • npm - npx yayfetch

  • bun -bunx yayfetch

or install it globally:

bun install --global yayfetch/npm install -g yayfetch and then just call yayfetch!

Flag-defined features

-p or --pick - first asks you what information you want to display, then displays it

-c <color> or --color <color> - allows to specify in which color the data will be shown in predefined colors. Cannot be used with --rgb flag. Available predefined colors: pink(default), orange, green, white, black, red, blue, yellow, violet, rainbow

--rgb r,g,b - specify RGB values in which data will be shown. Cannot be used with -c(--color) flag. Example npx yayfetch --rgb 125,25,78

--no-logo - prints data without ASCII art

--custom-lines {[key]: value, [key2]: value2, ...} - object with {[key]: value} string pairs separated by spaces ex. '{"Funny:": "joke", "exampleline:": "examplevalue"}'. This is being parsed using JSON.parse, so if you encounter any problem, make sure that string you provided can be parsed by it.

--no-colored-boxes - hides the colored boxes underneath the information.

-h or --help - shows available flags.

--config <path_to_file> - specify a file path to a custom config. See here

Config-specific features

Some more advanced features are almost impossible to implement through flags(to be quite honest, some are already pushing it e.g. --custom-lines).

  • Custom ASCIIs

To customize the ASCIIs just define "ascii" line in the config. It should be an Array<string> with path(s) to the ASCII(s).

Example:

{
  "ascii": ["./path/to/file.txt", "./path/to/2nd/file.txt"]
}
  • Custom images

You can also defined iamges instead of ASCIIs, by defining images field. Note that this flag is mutually exclusive with ascii flag. Uses terminal-image underneath, so refer to it when specifying options.

interface ImageOptions {
  path: string;
  options?: {
    width?: string | number | undefined;
    height?: string | number | undefined;
    preserveAspectRatio?: boolean | undefined;
  };
}

Example:

{
  "image": {
    "path": "./path/to/file.img",
    "options": { "preserveAspectRatio": false }
  }
}
  • Line Animations

Output can be animated by line-animations flag in the config file. It should be an AnimationOptions object.

type Animations = 'colors' | 'flowing-rainbow';
interface AnimationOptions {
  type: Animations; // Animations - applied per column basis
  msFrequency: number; // How fast should the animation be
}

Note: Printing to stdout is not performant, so it may not work well with less performant console environments

Example:

{
  "line-animations": {
    "type": "flowing-rainbow",
    "msFrequency": 150
  }
}

Example config

You can specify options through a file and use them by using --config <path_to_file>. Config file should contain a JSON object with keys representing flags.

Note that every flag with a prefix of --no- just negates the flag that is on by default. For example CLI flag --no-colored-boxes negates colored-boxes flag, which is true by default. This is important for creating a config, because if you want to invoke --no-colored-boxes through config, you would provide a "colored-boxes": false in JSON object.

Example config:

{
	"color": "blue",
	"colored-boxes": false,
	"logo": false,
	"custom-lines": {"Funny:": "joke", "exampleline:": "examplevalue"}
}

It doesn't work!

If it doesn't work for you make sure that you have the newest node(it's developed using node 18.18.0).

If you came here because of the 'Error - check https://www.npmjs.com/package/yayfetch for more' error, then most likely the software just can't detect the information. Why? Because of the system you use. It may not work when:

  1. You're using linux subsystem for windows
  2. Your system is within virtual machine

yayfetch's People

Contributors

dependabot[bot] avatar golota60 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

carlosjordandev

yayfetch's Issues

Add emojis support

Prettify our messages and errors with emojis. TBD if emojis should be enabled or disabled by default. Flag to be used is also an open question

Differentiate between linux distros

Right now, all linux distros come up as just 'linux' in the script. PR for this should change Platform: to also show the distro. Also, if we can show DE that would be superb too

Image support

Add image support (same behavior/place as asciis) also use this if possible

Change `--hide-logo` flag to `--no-logo`

Pretty self explanatory! Change --hide-logo flag to --no-logo since it's shorter and most apps use no keyword instead of hide. If you have any questions don't be afraid, ask below!

Improve text wrapping

Currently, when the terminal is too small, text wraps in a really ugly way. It does so in a way that if ANY line is too long, it will make EVERY line take 2 rows. Ideal solution is to make it so that the only line that wraps is the one that is "overflowed"

Fix uptime bug

Currently, 'Uptime' seems to sometimes give random values. The goal of this issue is to fix it

Improve release cycle

Manual releasing is a pain. Right now it's handled via package.json prepublishOnly script, which is really janky. This is a reminder to improve it sometime

Print Pink yayfetch logo with every usage

Right now, there are no ASCII art printed. There is an issue for printing the code of your OS(see #14 ), but for now, just printing the pink yayfetch logo will suffice.

  1. The logo should be in the same RGB color of pink that the yayfetch logo is in
  2. The logo should not be too wide - we don't want to break any lines

Specify a predefined color

Add a -c --color flag that changes the color of the printed information. Use predefined colors. RGB support to be added later

Refactor the code

Currently, the code is in shambles, so
As a programmer
I want a clearer code
So that so it can help me read it and add more features more easily

Add Promise Rejection Handling

On systems where you can't get system information reliably it's needed to handle the errors in data delivered asynchronously via promises.
Right now it displays an error instead of any indication as to why doesn't it work

Introduce TypeScript

Right now, the code doesn't have TypeScript, and it's a good practice to use it
As a programmer
I want TS introduced
So that so it can help me read code and add more features more easily

Add rgb support

Extension of #34. Add a possibilty of specifying rgb colors to change the color of the print

Improve error handling

Right now, error handling is pretty terrible - this task is here to remind me or whoever wants to implement that it needs to be improved

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.