helix-generator

1.0.1 • Public • Published

helix generator

generate a string of any two characters in combination.

installation

Install globally to use anywhere and get CLI a output a desired helix combination.

npm i -g helix-generator

Local installation can be done as follows.

npm i -S helix-generator
Width works best with even numbers.

usage

Global usabe

helix-generator <helix arguments> -w <width> --cycles <number of cycles> 

Local Usage

import helixGenerator from 'helix-generator';

helixGenerator(<helix arguments>, <width default=8>, <number of cycles>);

example

CLI example

The following CLI input, with helix arguments 🍯 🐞 and two cycles as -c 2:

$ helix-generator 🍯 🐞 -c 2

will generate the following output:

 🍯          🐞
  🍯        🐞
   🍯      🐞
     🍯  🐞
       🍯
     🐞  🍯
   🐞      🍯
  🐞        🍯
 🐞          🍯
 🐞          🍯
  🐞        🍯
   🐞      🍯
     🐞  🍯
       🐞
     🍯  🐞
   🍯      🐞
  🍯        🐞
 🍯          🐞
 🍯          🐞
  🍯        🐞
   🍯      🐞
     🍯  🐞
       🍯
     🐞  🍯
   🐞      🍯
  🐞        🍯
 🐞          🍯
 🐞          🍯
  🐞        🍯
   🐞      🍯
     🐞  🍯
       🐞
     🍯  🐞
   🍯      🐞
  🍯        🐞
 🍯          🐞

Node example

Run the following commands to initialize npm and install helix-generator

npm init -y
npm i -S helix-generator

Then create an index.js file with the following line.

const generator = require('helix-generator');

console.log(generator(['🤡', '👿', '🤘🏽'], 4, 2));

This will yeild the following output.

🤡      👿      🤘🏽
  🤡        👿🤘🏽  
    🤡      🤘🏽👿  
        🤡🤘🏽    👿
      🤘🏽    🤡  👿
  🤘🏽          🤡  
🤘🏽          👿  🤡
🤘🏽        👿    🤡
  🤘🏽  👿      🤡  
  👿🤘🏽      🤡    
👿      🤘🏽🤡      
👿    🤡    🤘🏽    
  👿          🤘🏽  
🤡  👿          🤘🏽
🤡      👿      🤘🏽
  🤡        👿🤘🏽  
    🤡      🤘🏽👿  
        🤡🤘🏽    👿
      🤘🏽    🤡  👿
  🤘🏽          🤡  
🤘🏽          👿  🤡
🤘🏽        👿    🤡
  🤘🏽  👿      🤡  
  👿🤘🏽      🤡    
👿      🤘🏽🤡      
👿    🤡    🤘🏽    
  👿          🤘🏽  
🤡  👿          🤘🏽

incoming features

  • [ ] output to file
  • [ ] error messages
  • [x] implement as npm package
  • [x] dynamically changing template for 3+ symbols
  • [x] extendable number of symbols

Readme

Keywords

none

Package Sidebar

Install

npm i helix-generator

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

7.91 kB

Total Files

6

Last publish

Collaborators

  • surajm