From d1d621168e5803fcbccbc3a9d18ab359f346f8aa Mon Sep 17 00:00:00 2001 From: GauravWalia19 <gauravwalia019@gmail.com> Date: Sat, 21 Aug 2021 22:12:28 +0530 Subject: [PATCH] Updated README --- .github/workflows/publish package.yaml | 4 +- README.md | 111 ++++++++++++++++++++++--- package.json | 4 +- 3 files changed, 104 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish package.yaml b/.github/workflows/publish package.yaml index 791357a..9401cc1 100644 --- a/.github/workflows/publish package.yaml +++ b/.github/workflows/publish package.yaml @@ -27,5 +27,5 @@ jobs: node-version: '14.x' registry-url: 'https://registry.npmjs.org' - run: npm publish --ignore-scripts - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 1be9072..9e27a87 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,22 @@ <h1 align="center">Rainbow JS</h1> </p> -Node JS Minimalist Library for making colorful terminal experiences. +Node/Deno JS Minimalist Library for making colorful terminal experiences. -      +## Features + +* Minimalist library to add colors to terminal +* No need to learn hexadecimal color codes +* Print alphabets on terminal easily using Alphabet library +* Supports Deno JS from GitHub and NPM registry +* Smallest library to build terminal based JS Games + ## Installation ```shell @@ -31,14 +38,101 @@ git clone https://github.com/TechOUs/rainbowjs.git # After this you will get a folder (js module) that you can use in your project ``` -## Usage +## Core Usage + +We support the core Rainbow Library for nodejs and denojs mainly + +### Node JS ```javascript +// Method 1 : Create Rainbow module object to access the functions const Rainbow = require('@techous/rainbowjs'); -const rainbow = new Rainbow(); +// Use Rainbow.<METHOD> +console.log(Rainbow.checkFormat('blink')); +// OUTPUT : true + +// Method 2 : Use function names directly which you want to import +const {checkFormat} = require('#techous/rainbowjs'); +console.log(checkFormat('blink')); +// OUTPUT : true +``` + +### Deno JS + +```javascript +// Method 1: Use code directly from github +import { + checkFormat +} from 'https://raw.githubusercontent.com/TechOUs/rainbowjs/master/src/deno/index.js' +console.log(checkFormat('blink')); +// OUTPUT : true + +// Method 2: Use code from npm package cdn +import { + checkFormat +} from 'https://cdn.skypack.dev/@techous/rainbowjs/deno'; +console.log(checkFormat('blink')); +// OUTPUT : true +``` + +## Alphabet Library Support (Supported from 2.0.0) -// rainbow.<INSTANCE METHOD> -// Follow the documentation for all the instance methods +We added this new library in version 2.0.0 to print the Alphabets easily on the terminal +that reduces the time to print the alphabets again and again + +### Node JS + +```javascript +// Method 1 : Create Rainbow module object to access the functions +const Alphabet = require('@techous/rainbowjs/Alphabet'); +// Use Alphabet.<METHOD> +Alphabet.printString('#', 'Tests', ' '); +// OUTPUT +// ##### ### ## # ## +// # # # # ### # +// # ##### # # # +// # # # # # +// # #### ## ## ## + +// Method 2 : Use function names directly which you want to import +const {printString} = require('@techous/rainbowjs/Alphabet'); +printString('#', 'Tests', ' '); +// OUTPUT +// ##### ### ## # ## +// # # # # ### # +// # ##### # # # +// # # # # # +// # #### ## ## ## +``` + +### Deno JS + +```javascript +// Method 1 : Use the code directly from github +import { + getString, + printString +} from 'https://raw.githubusercontent.com/TechOUs/rainbowjs/master/src/deno/Alphabet.js' +printString('#', 'Tests', ' '); +// OUTPUT +// ##### ### ## # ## +// # # # # ### # +// # ##### # # # +// # # # # # +// # #### ## ## ## + +// Method 2 : Using npm cdn +import { + getString, + printString +} from 'https://cdn.skypack.dev/@techous/rainbowjs/deno/Alphabet.js' +printString('#', 'Tests', ' '); +// OUTPUT +// ##### ### ## # ## +// # # # # ### # +// # ##### # # # +// # # # # # +// # #### ## ## ## ``` ## Documentation @@ -49,11 +143,6 @@ Coming Soon! For contribution guidelines please follow [this guide](https://github.com/TechOUs/rainbowjs/blob/master/.github/CONTRIBUTING.md) -```javascript -// import {checkFormat} from 'https://raw.githubusercontent.com/TechOUs/rainbowjs/master/src/deno/index.js'; -// import {checkFormat} from 'https://cdn.skypack.dev/@techous/rainbowjs'; // test from published package -``` - ## LICENSE [](LICENSE) \ No newline at end of file diff --git a/package.json b/package.json index 7fe5b36..cd74fb9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@techous/rainbowjs", - "description": "Library to show colorful text on nodejs terminal", - "version": "1.0.1", + "description": "Node/Deno JS Minimalist Library for making colorful terminal experiences.", + "version": "2.0.0", "main": "src/index.js", "author": "Gaurav Walia <gauravwalia019@gmail.com>", "scripts": {