1.0.1 β€’ Published 5 years ago

helix-generator v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

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

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
  • implement as npm package
  • dynamically changing template for 3+ symbols
  • extendable number of symbols