1.0.1 β’ Published 5 years ago
helix-generator v1.0.1
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