npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mongodb-model/couleurs

v0.0.10

Published

couleurs

Downloads

13

Readme

Couleurs

Couleurs helps in styling,coloring text (string), and terminals. Couleurs is a duplex stream, specifically a Transform stream with some functionalities added. It uses full power of the NodeJs Native Transform Stream API. In other words, everything you can do with NodeJs Native Transform API you can do with couleurs! Couleurs is very highly event driven. Its common use is by extension or by using object destruction to get the instance methods needed. "Couleurs" is the french word for "colors".

Installation

$ yarn add @mongodb-model/couleurs

or


$ npm i @mongodb-model/couleurs

Simple Usage Examples

Making api request (http request)

const Couleurs = require('@mongodb-model/couleurs');
const couleur = new Couleurs();
couleur.apiGet(); //base.apiGet(your api endpoint)
couleur.on('apiGet', data => console.log(data));
couleur.on('apiGet-error', error => console.error(error));

By extension

class MyWonderfulClass extends require('@mongodb-model/couleurs') {

    constructor(...arrayOfObjects) {

    super({ objectMode: true, encoding: "utf-8", autoDestroy: true });

    arrayOfObjects.forEach(option => {
        if(Object.keys(option).length > 0){
          Object.keys(option).forEach((key) => { if(!this[key]) this[key] = option[key];})
        }
    });

    this.autobind(MyWonderfulClass);
    this.autoinvoker(MyWonderfulClass);
    this.setMaxListeners(Infinity);
  }
};

Couleurs methods usage example


const Couleurs = require('@mongodb-model/couleurs');

// You may use object destruction to get methods needed from the instance.
const {Color_Off,Green,BBlue,Blinker,Bold,SetColor,Underline} = new Couleurs

// output green text
console.log(Green('I am green and I like it!'))

// output bold blue text
console.log(BBlue('I am Bold Blue and I like it!'))

// output blinking text (depending on bash shell version it may not work. It may not work on older bash versions)
console.log(Blinker('I am blinking and I like it!'))

// output bold  text
console.log(Bold('I am bold and I like it!'))

// output underline text
console.log(Underline('I am underline and I like it!'))

// reset text style to default and outputs it
console.log(Color_Off('I am reset to my default style and I like it!'))

Available Couleurs methods


    // Reset text style to default
    Color_Off(string = 'coloring?');       // Text Reset

    // Regular Colors
    Black(string = 'coloring?');        // Black
    Red(string = 'coloring?');          // Red
    Green(string = 'coloring?');        // Green
    Yellow(string = 'coloring?');       // Yellow
    Blue(string = 'coloring?');         // Blue
    Purple(string = 'coloring?');       // Purple
    Cyan(string = 'coloring?');         // Cyan
    White(string = 'coloring?');        // White
    
    // Bold
    BBlack (string = 'coloring?');       // Black
    BRed(string = 'coloring?');         // Red
    BGreen(string = 'coloring?');       // Green
    BYellow(string = 'coloring?');      // Yellow
    BBlue(string = 'coloring?');        // Blue
    BPurple(string = 'coloring?');      // Purple
    BCyan(string = 'coloring?');        // Cyan
    BWhite(string = 'coloring?');       // White
    
    // Underline
    UBlack(string = 'coloring?');       // Black
    URed(string = 'coloring?');         // Red
    UGreen(string = 'coloring?');       // Green
    UYellow(string = 'coloring?');      // Yellow
    UBlue(string = 'coloring?');        // Blue
    UPurple(string = 'coloring?');      // Purple
    UCyan(string = 'coloring?');        // Cyan
    UWhite(string = 'coloring?');       // White
    
    // Background
    On_Black(string = 'coloring?');       // Black
    On_Red(string = 'coloring?');         // Red
    On_Green(string = 'coloring?');       // Green
    On_Yellow(string = 'coloring?');      // Yellow
    On_Blue(string = 'coloring?');        // Blue
    On_Purple(string = 'coloring?');      // Purple
    On_Cyan(string = 'coloring?');        // Cyan
    On_White(string = 'coloring?');       // White
    
    // High Intensity
    IBlack(string = 'coloring?');       // Black
    IRed(string = 'coloring?');         // Red
    IGreen(string = 'coloring?');       // Green
    IYellow(string = 'coloring?');      // Yellow
    IBlue(string = 'coloring?');        // Blue
    IPurple(string = 'coloring?');      // Purple
    ICyan(string = 'coloring?');        // Cyan
    IWhite(string = 'coloring?');       // White
    
    // Bold High Intensity
    BIBlack(string = 'coloring?');      // Black
    BIRed(string = 'coloring?');        // Red
    BIGreen(string = 'coloring?');      // Green
    BIYellow(string = 'coloring?');     // Yellow
    BIBlue(string = 'coloring?');       // Blue
    BIPurple(string = 'coloring?');     // Purple
    BICyan(string = 'coloring?');       // Cyan
    BIWhite(string = 'coloring?');      // White
    
    // High Intensity backgrounds
    On_IBlack(string = 'coloring?');   // Black
    On_IRed(string = 'coloring?');     // Red
    On_IGreen(string = 'coloring?');   // Green
    On_IYellow(string = 'coloring?');  // Yellow
    On_IBlue(string = 'coloring?');    // Blue
    On_IPurple(string = 'coloring?');  // Purple
    On_ICyan(string = 'coloring?');    // Cyan
    On_IWhite(string = 'coloring?');   // White

    // Intensity
    Reset(string = 'coloring?');
    Bright(string = 'coloring?');
    Dim(string = 'coloring?');
    Underscore(string = 'coloring?');
    Blink(string = 'coloring?');
    Reverse(string = 'coloring?');
    Hidden(string = 'coloring?');
    
    // Foreground
    FgBlack(string = 'coloring?');
    FgRed(string = 'coloring?');
    FgGreen(string = 'coloring?');
    FgYellow(string = 'coloring?');
    FgBlue(string = 'coloring?');
    FgMagenta(string = 'coloring?');
    FgCyan(string = 'coloring?');
    FgWhite(string = 'coloring?');
    
    // Gackground
    BgBlack(string = 'coloring?');
    BgRed(string = 'coloring?');
    BgGreen(string = 'coloring?');
    BgYellow(string = 'coloring?');
    BgBlue(string = 'coloring?');
    BgMagenta(string = 'coloring?');
    BgCyan(string = 'coloring?');
    BgWhite(string = 'coloring?');

    // Reset
    SetColor( string ='coloring!', R = 30, G = 2, B = 208);

    // Styling 
    Underline(string ='coloring!', R = 30, B = 208);
    Strikethrough(string ='coloring!', R = 30, B = 208);
    Bold(string ='coloring!', R = 30, B = 208);
    Italic(string ='coloring!', R = 30, B = 208);
    Highlight(string ='coloring!', R = 30, B = 208);

    //Hide
    Hide(string ='coloring!', R = 30, B = 208);

    // Blinking
    Blinker(string ='coloring!', R = 30, G = 2);

Author's Info

Website|NPM|Github|Gitlab|Blog|LinkedIn|Facebook|Twitter|Instagram| --- | --- | --- | --- | --- | --- | --- |--- |--- | Website|NPM|Github|Gitlab|Blog|LinkedIn|Facebook|Twitter|Instagram|