1.2.1 • Published 5 months ago

davidgs v1.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 months ago

npx-card

$ npx davidgs

Generate your own npx <your_username> card easily with provided configurations. 😃 Fork & get started and leave a star ⭐ to this repo

NOTE: Do not install this package as a global package i.e. npm -g davidgs. Always use npx davidgs to view the card as this package won't be used as any other command


available scripts

  • build: to build the output (entry point for the script: src/index.js)
  • view: to view the output (entry point for the script: src/card.js)
  • prepublish: runs before the npm publish command to generate the build

files:

file namepathusage
index.jssrc/entry point file / to generate the output
card.jssrc/to read the output
boxen.config.jssrc/config/boxen color, bgColor, style, etc configuration
chalk.config.jssrc/config/chalk configuration for various methods
io.config.jssrc/config/io provide the path of output file
boxUI.jssrc/user/boxen js user defined UI options
data.jssrc/user/user data with configuration
createConsoleString.jssrc/utils/creates the console string which need to be saved as output
io.jssrc/utils/to read and write the file to the output location
outputbin/output file which needs to be displayed

config files:

  • boxen.config.js: provides the various colors, styles, text aligns and box styles parameters.

    • exports: This file exports four objects:
      • BOXEN_COLOR: BLACK, RED, GREEN, etc...
      • BORDER_STYLE: TOPLEFT, TOP, TOPRIGHT, RIGHT, BOTTOMRIGHT, BOTTOM, BOTTOMLEFT, LEFT
      • TEXTALIGN: LEFT, RIGHT, CENTER
      • BOX_STYLE: SINGLE, DOUBLE, ROUND, BOLD, SINGLEDOUBLE, DOUBLESINGLE, CLASSIC, ARROW
    • usage: for complete usage and for more example please visit BoxenJS
    import {
      BOXEN_COLOR,
      BORDER_STYLE,
      TEXTALIGN,
      BOX_STYLE
    } from './config/boxen.config.js' // use relative path here to your file
    
    // use these while creating boxUI.js or while using boxen() method
    
    BOXEN_COLOR.RED     // to provide color to the box
    BOXEN_STYLE.ROUND   // to provide border style to the box
    TEXTALIGN.RIGHT     // to provide the text align in the box
    BORDER_STYLE.TOP    // to provide custom deign to the box
  • chalk.config.js: It provides colors, background colors, Modifiers and color methods for custom color.

    • exports: This file exports four objects
      • COLORS: colors methods
      • BGCOLORS: background color methods
      • MODIFIERS: style modifiers for the text
      • COLORMETHODS: methods to provide the custom colors / user defined colors
    • usages: for complete usage and for more example please visit ChalkJS
    import {
      COLORS,
      BGCOLORS,
      MODIFIERS,
      COLORMETHODS
    } from './config/chalk.config.js'; // use relative path here to your file
    
    // use these methods in data.js file or with chalk library
    COLORS.blue         // provide color to the text
    BGCOLORS.white      // provide background color to the text
    MODIFIERS.bold      // provide styles to the text
    COLORMETHODS.rgb    // use method to provide custom colors for both text color and text background color
  • io.config.js: provide the __dirname functionality to the ES modules to generate output correctly


How to publish your own card:

  • fork/clone this repo
  • change the data in src/user/data.js file
  • login to your npm account using npm login
  • publish this to npm using npm publish
  • udpate the package version using below commands
    • patch: npm version patch to update last version number v1.0.1
    • minor: npm version minor to update middle version number v1.1.0
    • major: npm version major to update the first version number v2.0.0

License

MIT Copyright (c) 2023 David G. Simmons (davidgs)

1.2.0

5 months ago

1.1.3

5 months ago

1.2.1

5 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago