Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
GauravWalia19 committed Aug 21, 2021
1 parent 87bdc03 commit d1d6211
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
111 changes: 100 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

![Travis (.org)](https://img.shields.io/travis/TechOUs/rainbowjs?style=for-the-badge)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/TechOUs/rainbowjs?style=for-the-badge)
![GitHub package.json version](https://img.shields.io/github/package-json/v/TechOUs/rainbowjs?style=for-the-badge)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/TechOUs/rainbowjs?style=for-the-badge)
![GitHub last commit](https://img.shields.io/github/last-commit/TechOUs/rainbowjs?style=for-the-badge)
![npm](https://img.shields.io/npm/dw/@techous/rainbowjs?style=for-the-badge)

## 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
Expand All @@ -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
Expand All @@ -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

[![GitHub](https://img.shields.io/github/license/TechOUs/rainbowjs?style=for-the-badge)](LICENSE)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"scripts": {
Expand Down

0 comments on commit d1d6211

Please sign in to comment.